FYI this: if ('http://example.com/foo/bar.html' === $('a', $(this)).attr ('href')) { alert('Hooray!'); }
is the same as your original code, except for the full url. On Jul 8, 3:25 am, "brightdad...@googlemail.com" <brightdad...@googlemail.com> wrote: > Yes it worked! > > On Jul 8, 10:09 am, "brightdad...@googlemail.com" > > > > <brightdad...@googlemail.com> wrote: > > Hi Experts, > > > I am trying to conditionally test what the value of href is equal to. > > > like this; > > > if($(this).find('a').attr("href")=="map.html"){ > > alert("yes"); > > > } > > > This doesn't work. Do anyone knows what i am doing wrong. > > > Psuedocode please.