This should definitely work, with a live test page it would be much easier to say anything about it.
What version of jQuery are you using and on which browser does it occur? On Jan 16, 2:48 pm, CreativeMind <aftab.pu...@gmail.com> wrote: > $('li.tabs-selected') also shows undefined.. i m unable to find li > with the help of class 'tabs-selected'.. > > On Jan 16, 1:28 am, Balazs Endresz <balazs.endr...@gmail.com> wrote: > > > Now that's another one: > > > $('li').hasClass('.tabs-selected') > > and > > $('li').is('.tabs-selected') > > > only tell you if "li" has that class or not, > > if you want to select by class do this: > > $('li.tabs-selected') > > > On Jan 15, 9:11 pm, CreativeMind <aftab.pu...@gmail.com> wrote: > > > > hi, > > > here is the html source of a list. > > > <li class="xsnazzy" > > > > <a href="#frMap" style="text-decoration:none;text-indent:5px;"><b > > > class='xtop'> > > > <b class='xb1 '></b><b class='xb2 color_a'></b><b class='xb3 '></b> > > > <b class='xb4 color_a'></b></b><span class="xboxcontent"> > > > <h1>Map</h1></span></a></li> > > > ------------------ > > > here is the generated html source of a list. > > > <li class="xsnazzy top-left tabs-selected" > > > > <a href="#frMap" style="text-decoration: none; text-indent: 5px;"> > > > <b class="xtop"><b class="xb1"></b><b class="xb2 color_a"></b> > > > <b class="xb3"></b><b class="xb4 color_a"></b></b> > > > <span class="xboxcontent"><h1>Map</h1></span></a></li> > > > ------------------- > > > the problem is when i try to find $('li').hasClass('.tabs-selected'), > > > or $('li').is('.tabs-selected') > > > it returns me undefined... but it exists in the generated html..how > > > can i find that class.