On Jun 12, 2007, at 9:57 PM, Dan G. Switzer, II wrote:


If you run this example, the <div /> has a yellow background and the <p />
has a pink background.

However, only the <div /> get it's text appended to it. You can work around
it by doing:

$("[EMAIL PROTECTED]'bam']").append(" -- pink");

yep. that's the workaround.

This just isn't exactly intuitive and can be confusing to people who'd
expect a valid CSS selector rule to work in jQuery.

True, it can be confusing. But a lot of things are potentially confusing to people who are writing HTML that isn't valid. A few months ago I hung out on the CSS IRC channel, but I had to stop after a few days because it was too excruciating to hear person after person complaining about how CSS wasn't working right, only to discover that they're HTML wasn't valid.

Others have said it here on the list before, and I agree, that it's a fool's errand to try to make jQuery anticipate the ways in which people are going to write bad markup.



--Karl
_________________
Karl Swedberg
www.englishrules.com
www.learningjquery.com



Reply via email to