logo       

Re: attach a click event to everything but one TRelement...??: msg#01247

lang.javascript.jquery

Subject: Re: attach a click event to everything but one TRelement...??

> Don't use underscores in element IDs. It's not a valid
> character, and some browsers (like, MSIE) will not do what
> you want if you use it.
>
> http://devedge-temp.mozilla.org/viewsource/2001/css-underscores/
>
> Use hyphens, if you insist on using a visual separator.

That's not quite right. Underscores are valid ID characters in HTML 4 and
CSS 2.1:

http://www.w3.org/TR/html4/types.html#type-name

http://www.w3.org/TR/CSS21/grammar.html

The devedge article cautions against underscore in an ID because of
inconsistent support in old browsers, but note that the article was written
in 2001 and is talking about *really* old browsers. It says that Netscape
4.x and Opera up through 5.x have problems with underscores, but those
aren't supported by jQuery anyway.

I think all the browsers supported by jQuery handle underscores in IDs with
no problem.

-Mike


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise