tags:

views:

24

answers:

1

<area shape="poly" coords="63,10,64,38,89,37,91,10" class={"strokeColor:'0000ff',strokeWidth:5, fillColor:'ff0000',fillOpacity:0.6}" href="#" id="x1">

There is a imagemap in my html and I want to dynamicly add a new configuration "alwaysOn:true" to the class attribute.

I cannot figure out how to add config option How can I do that with jquery?

A: 

Look into jquery attributes.

You need something along the lines of . . .

$("#x1").click(function(){

var oldClass = $(this).attr("class");
$(this).attr("class", oldClass + ' alwaysOn:true');

});
Robert
not only after click I want it immediately but dynamically sois it $("x1").attr("class", oldClass + ' alwaysOn:true');
dupdup