I'm adding unique ids and classes to different elements like this,
<div id="%'@#K!NG,<$wE3T?">Sweet</div>
So I looked up, What are valid values for the id attribute in HTML? There I read the much acclaimed:
ID and NAME tokens must begin with a letter ([A-Za-z]) and may be followed by any number of letters, digits ([0-9]), hyphens ("-"), underscores ("_"), colons (":"), and periods (".").
But then experimenting on my own it seems that it's much more flexible than that. Both of these work:
$(document.getElementById("%'@#K!NG,<$wE3T?")).text();
document.getElementById("%'@#K!NG,<$wE3T?").innerHTML;
Is there some pitfall I don't see if I include characters like !@#$%^&*()<>}| in id names?