If you use jQuery, this could be as easy as:
$("#w1").click(function() {
$(this).addClass('myClass');
});
Note that, by using $(this) you automatically refer to the element that was clicked. This is handy as you mention there are many clickable seats, each with a unique id. Instead of manually creating an event handler for each clickable seat ("w1", "w2", etc.) it's simpler to use a selector which matches any of the seats. Assume all the seats are inside a tag with id "seats" and that each seat is represented with an "a" tag:
$("#seats a").click(function() {
$(this).addClass('myClass');
});
So your markup would be something like this:
<div id="seats">
<a id="w1">seat 1</a>
<a id="w2">seat 2</a>
....
</div>
Furthermore, if you wanted the user to be able to click the seat again to unselect it, use toggleClass instead of addClass:
$("#seats a").click(function() {
$(this).toggleClass('myClass');
});
Note that you don't have to use jquery to implement all of this. You could do it in raw javascript or you could use a different javascript framework. But if you have the choice, jquery makes coding this up a lot easier.
not working?$('#w1').click(function() { this.addClass('myClass'); });