I'm a noob when it comes to javascript. Excuse my ignorance!
Is there any way to replicate the CSS version of "class" for javascript?
Say I have like seventeen elements that I want to all use the same javascript
:
Code:
onmouseover="this.style.backgroundColor='#e6e6e6'; this.style.cursor='pointer';" onmouseout="this.style.backgroundColor='#FFFFFF';" onclick="toggle('type'); toggle('mail')
It would be a pain to copy all of those into each div/table/td etc. Isn't there a way to replicate this kind of functionality: class="toggle" to make it easier?
I searched some ways on Google and found some good ways of doing stuff through functions... but not really what I was looking for.