![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I have something like: span id ="SomeID1" onclick = "Clicked(this.id)"> <div class=c1 Something here </div></span span id ="SomeID2" onclick = "Clicked(this.id)"> <div class=c2 Something here </div></span span id ="SomeID3" onclick = "Clicked(this.id)"> <div class=c3 Something here </div></span ....thousands others ... Q. Is it possible to define a class style for the <span> so that it would include onclick = "Clicked(this.id)" and so that I have not to repeat the onclick it for each span? |
#3
| |||
| |||
|
|
pamelafluente (AT) libero (DOT) it schrieb: I have something like: span id ="SomeID1" onclick = "Clicked(this.id)"> <div class=c1 Something here </div></span span id ="SomeID2" onclick = "Clicked(this.id)"> <div class=c2 Something here </div></span span id ="SomeID3" onclick = "Clicked(this.id)"> <div class=c3 Something here </div></span ....thousands others ... Q. Is it possible to define a class style for the <span> so that it would include onclick = "Clicked(this.id)" and so that I have not to repeat the onclick it for each span? No, CSS is about presentation, not behaviour. But you can add a listener for click events by JavaScript. However this is off-topic in a stylesheet group. Please ask in a JavaScript group. -- Johannes Koch In te domine speravi; non confundar in aeternum. (Te Deum, 4th cent.) |
![]() |
| Thread Tools | |
| Display Modes | |
| |