Possible Duplicate:
special characters in id of html tags
I have a DIV with the id as email:
<div id="example@example.com">This is blah blah text</div>
Now with jQuery, I want to select that DIV and hide it:
$('#example@example.com').hide();
And that’s not working!
Since I’m generating these DIVs dynamicly and I don’t want to query the db again for the real row IDs, I’m gonna use the email addresses as IDs, and I can’t do it…
Any solution to this?
Thanks in advance
You cannot use “example@example.com” as an html element’s id, instead use data attribute like this
Then use jQuery to select it like this