I'm not really sure on this, but would there need to be quotes around the # in the filter? Actually its possible there would be more quotes? var link = $(this+"[href^='#']").val(); Just a guess, but worth a try.
-CodingCyb.org On Nov 18, 7:57 pm, daniel <[EMAIL PROTECTED]> wrote: > Maybe it's the really late night I had but I can't figure this one > out. First the html: > > <div> > <a href="#internal">Internal Link</a> > <a href="http://external.com">External Link</a> > <a href="#internal2">Internal Link2</a> > </div> > ------------------------------------ > in order to do something on the page instead of going to the link I > need to filter it based on if it contains a # at the start. It's the > perfect problem for the [attribute^=value] solution but this doesn't > work... > > var link = $(this[href^=#]).val(); > ------------------------------------ > I just know it's an issue with how to put this and the attribute > qualifier together... and I don't know what to put afterwards .val()?! > I've also tried: > var link = $(this).attr("[href^=#]"); > > thanks