homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

Remove id attribute

 2:11 pm on May 16, 2012 (gmt 0)

If I have <div id="name1"> I can change the id to something else using:


What can I do if I just want to remove the id and just have <div>? Would I use:


Or would that just set the div to <div id="">?



 2:28 pm on May 16, 2012 (gmt 0)


Setting id to an empty string will not remove the attribute. You can verify this by using browser tools like Firebug or Chrome's Developer Tool to inspect the element and you'll still see an empty id attribute defined.


 3:37 pm on May 16, 2012 (gmt 0)

Perfect, thanks!

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved