I have a little span element which I CSSed the f*** out of so that it appears as a switch. It kind of like this:
<Span class="switchbody" value="on"><span class="switchcover">on</span></span>
I wanted to know, if I added an onclick="editswitch()" to the first span element, would it be possible if I passed a Variable containing a unique value so that the JavaScript function knows which switch I am talking about without me having to write a million functions doing exactly the same thing to different elements?
If it is possible, how would I do that
PS I have tried
<span onclick="getId = "switch one";">
If it is possible, no jquery or php, etc. Just JavaScript.