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
Post a Comment