Are dashes/hyphens safe for ID names?
Posted: Mon Jan 11, 2010 5:51 am
I must say I am really confused, I have been reading articles on what is allowed and not when giving HTML elements, IDs.
I want to use:
<input type="checkbox" class="checkbox" id="my-option" name="my-option" />
Is it safe to use dash/hyphen in the ID? It doesn't generate an error for me but I've read some people saying JavaScript could treat "my-option" as "my minus option".
I want to use:
<input type="checkbox" class="checkbox" id="my-option" name="my-option" />
Is it safe to use dash/hyphen in the ID? It doesn't generate an error for me but I've read some people saying JavaScript could treat "my-option" as "my minus option".