-
Change Div ID On Click
Hi, I'm writing my first Firefox extension, and I'm having some problems.
The extension is basically a chrome-like new tab page for Firefox, and features swappable tiles. I used jQuery to get the tiles to swap, and they rely on a div id to be able to swap. I would like to set a link (or possibly a span or something) to change the div ID to lock it in place. Is this possible?
Thanks in advance.
Also, let me know if you'd be interested in joining the development effort, currently it's me and one other person. You can view the most up-to-date demo here: http://www.youtube.com/watch?v=RXtM3r6koTQ
-
-
You can add the ID attribute with attr()
$('p').attr('id', 'myID');
OR
$('.class').attr('id', 'myID');
Alternatively, you can use addClass/removeClass
$('p').removeClass('myClass noClass').addClass('yourClass');
OR
$('#div').addClass('myClass');
http://api.jquery.com/addClass/
-
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
Bookmarks