That's invalid mark-up, you can only have LIs as child elements of a list. The browser is creating a LI and putting those DIVs inside, that's why you're not finding them.
Your code should be like this: <ul> <li> <span>Analysis</span> <div class="accordionContent"> <p>Lorem Ipsum</p> </div> </li> <li> .. </li> </ul> On Jan 30, 9:35 am, elduderino <jamesfiltn...@gmail.com> wrote: > Hi, > > I'm having a problem wit using next(). I have this code which i've built in > to a simple test page which you could run to see my problem (obviously you > need jquery included in the same directory). > > IN firefox next finds the div and I get the alert back...as expected. the > div is a sibling of the list item and so should allow me to get to the > alert. However in IEx this does not happen. > > Any ideas why? I thought jquery was supposed to deal with browser > inconsitency?! > > anyways heres my code. Thanks in advance for any replies Smile > > Code: > <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" > "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> > <html xmlns="http://www.w3.org/1999/xhtml"> > <head> > <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> > <title>Untitled Document</title> > <script type="text/javascript" src="jquery.js"></script> > <script type="text/javascript"> > function accordion() { > var y = $('ul#accordion li'); > y.css({'color' : 'red'}) > y.click( > function() { > var current = $(this).next(); > if ((current.is('div')) && (current.is(':visible'))) { > alert('hi'); > } > } > );} > > </script> > </head> > <body> > <ul id="accordion"> > <li>Analysis</li> > <div class="accordionContent"> > <p>Lorem Ipsum is simply dummy text of the printing and > typesetting industry. Lorem Ipsum has been the industry's standard dummy > text ever since the 1500s, when an unknown printer took a galley of type and > scrambled it to make a type specimen book. It has survived not only five > centuries, but also the leap into electronic typesetting, remaining > essentially unchanged. It was popularised in the 1960s with the release of > Letraset sheets containing Lorem Ipsum passages, and more recently with > desktop publishing software like Aldus PageMaker including versions of Lorem > Ipsum.</p> > </div> > <li>Analysis</li> > <div class="accordionContent"> > <p>Lorem Ipsum is simply dummy text of the printing and > typesetting industry. Lorem Ipsum has been the industry's standard dummy > text ever since the 1500s, when an unknown printer took a galley of type and > scrambled it to make a type specimen book. It has survived not only five > centuries, but also the leap into electronic typesetting, remaining > essentially unchanged. It was popularised in the 1960s with the release of > Letraset sheets containing Lorem Ipsum passages, and more recently with > desktop publishing software like Aldus PageMaker including versions of Lorem > Ipsum.</p> > </div> > <li>Analysis</li> > <div class="accordionContent"> > <p>Lorem Ipsum is simply dummy text of the printing and > typesetting industry. Lorem Ipsum has been the industry's standard dummy > text ever since the 1500s, when an unknown printer took a galley of type and > scrambled it to make a type specimen book. It has survived not only five > centuries, but also the leap into electronic typesetting, remaining > essentially unchanged. It was popularised in the 1960s with the release of > Letraset sheets containing Lorem Ipsum passages, and more recently with > desktop publishing software like Aldus PageMaker including versions of Lorem > Ipsum.</p> > </div> > <li>Analysis</li> > <div class="accordionContent"> > <p>Lorem Ipsum is simply dummy text of the printing and > typesetting industry. Lorem Ipsum has been the industry's standard dummy > text ever since the 1500s, when an unknown printer took a galley of type and > scrambled it to make a type specimen book. It has survived not only five > centuries, but also the leap into electronic typesetting, remaining > essentially unchanged. It was popularised in the 1960s with the release of > Letraset sheets containing Lorem Ipsum passages, and more recently with > desktop publishing software like Aldus PageMaker including versions of Lorem > Ipsum.</p> > </div> > </ul> > <script type="text/javascript"> > accordion(); > </script> > </body> > </html> > -- > View this message in > context:http://www.nabble.com/next%28%29-working-in-ff-but-not-in-iex-tp21745... > Sent from the jQuery General Discussion mailing list archive at Nabble.com.