jquery - Change a buttons id on click -
i need change id attribute of div on click.
<div class="xtra" id="id1"><a href="#"><span>next</span></a></div> how that?
i've tried:
$j("#id1").attr('id', 'id2'); but didn't work.
try this:
$j("#id1").live('click',function(){ $(this).attr('id', 'id2'); //use 1 this.id = 'id2'; //or 1 <-- both same thing }) i not sure why ever want this, how it.
ids not meant change, meant unique specific element.
classes used when changing css , forth.
Comments
Post a Comment