Recall javascript array index value -


I am implementing a way to track clicks in a tabbed content section.

When I click any tab, the parameter is passing as click = tab 4. It should be clicked = tab (value of 0-3). It seems that this is returning the length of the array? How can I create an Event Listener function, keep the index value of the array.

Example: When I click on Tab 1, the "i" variable should be 0 in the event listener.

Here is my code. It works apart from one part, and I do not know why it may be.

  function clicktrack () {var tab = ['tab1', 'tab2', 'tab3', 'tab4']; For (i = 0; i    

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -