Currently, I am attempting to assign a javascript variable to one of several possibilities.
If a specific link has not been clicked (such as on the initial page load), then the variable should default to 0 or 1.
However, if one of those links has been clicked, I want the variable to receive the number associated with that particular link.
Imagine the HTML structure is like this:
<a href=""><img src="icon2.png" id="icon-2"></a> |
<a href=""><img src="icon3.png" id="icon-3"></a> |
<a href=""><img src="icon4.png" id="icon-4"></a> |
In jQuery, the variable setup could look something like this:
var icon_num = 2; // This will change based on which 'icon' is clicked.