Hi Shelane,

Looks like you just forgot the $ or jQuery before the opening parenthesis. This should work:

var initlink = $('a', 'div.nav_one_selected').attr("href");

--Karl
_________________
Karl Swedberg
www.englishrules.com
www.learningjquery.com



On Apr 26, 2007, at 4:10 PM, Shelane Enos wrote:


I have this:
<div class="nav_one_selected"><a
href="/jQuery/pages/index.html">Index</a></div>

I was attempting to read the href of the anchor tag like this:

var initlink = ('a', 'div.nav_one_selected').attr("href");

I also tried
var initlink = ('div.nav_one_selected/a').attr("href");

I get an error like: ('a', 'div.nav_one_selected').attr is not a function

I'm not sure what I'm doing wrong here.


Reply via email to