I am trying to set a javascript variable to be one of a few options.
If one of a few specific link shas not been clicked (i.e. the first page load), then the variable should be set to 0 or 1 (the default value).
If it has been clicked, then I want it to get a number associated with that link.
So say the html looks 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> |
The jQuery variable would be something like:
var icon_num = 2; // If 'icon-2' is clicked, etc.