suppose you have a jQuery element called: div div.children(":not(:first)").hide();
will hide every immediate child of the div, except the first one by(e) Stephan 2009/1/24 david.vansc...@gmail.com <david.vansc...@gmail.com>: > > Yeah, I figured it was probably something along those lines. So what > would be the best way to hide all but the first element of a DIV? > > > David > > On Jan 23, 11:12 pm, Karl Swedberg <k...@englishrules.com> wrote: >> Hi David, >> >> I suspect the unordered lists aren't being hidden because the browser >> will not recognize that they are within the paragraph. >> >> Paragraphs are not allowed to have any block-level elements inside of >> them: >> >> > The P element represents a paragraph. It cannot contain block-level >> > elements (including P itself). >> >> http://www.w3.org/TR/html40/struct/text.html#h-9.3.1 >> >> When you have an invalid DOM structure, script goofiness happens. >> >> --Karl >> >> ____________ >> Karl Swedbergwww.englishrules.comwww.learningjquery.com >> >> On Jan 23, 2009, at 3:46 PM, david.vansc...@gmail.com wrote: >> >> >> >> > The answer to this is probably really simple, but I'm just not finding >> > it. >> >> > I'm working on a newsletter and they want the first paragraph of each >> > article shown, then a More link at the end. Got that working fine. I >> > even have it working so that it automatically hides all but the first >> > paragraph tag. Perfect. However, I have a few unordered lists inside >> > paragraph tags and the unordered lists aren't hidden when the page >> > loads, even if they're inside the paragraph tags. How would I get >> > those elements to be hidden when the paragraph tag is hidden? Thanks!