Change ID?
Change ID?
Hi, I was wondering how to chance the ID of a object using jQuery? Is this the general idea? Also the way it's written, will the code change circle1 to circle 2, then change both circle2's to circle1?
- <div id="box1">
- <div id="circle1"></div>
- </div>
- <div id="box2">
- <div id="circle2"></div>
- </div>
- $(document).ready(function(){
- $("#Click").click(function() {
- $("#Circle1").removeClass('Circle1').addClass('Circle2');
- $("#Circle2").removeClass('Circle2').addClass('Circle1');
- });
- });