A friendly place for programming greenhorns!
Big Moose Saloon
Search
|
Java FAQ
|
Recent Topics
Register / Login
Win a copy of
Arduino in Action
this week in the
General Computing
forum!
A special promo:
Enter your blog post or vote on a blogger to be featured in an upcoming Journal
JavaRanch
»
Java Forums
»
Engineering
»
HTML, CSS and JavaScript
Author
child node issue
Naveen puttu
Ranch Hand
Joined: Sep 15, 2009
Posts: 88
posted
Feb 19, 2010 11:22:05
0
Hi
I have an anchor tag inside a div . im using
$('div#contactEmail > a')[0].attr('href','mailto:'+email);
its doesnt work
Help me out guys
Eric Pascarello
author
Rancher
Joined: Nov 08, 2001
Posts: 15362
6
posted
Feb 19, 2010 11:41:01
0
$('div#contactEmail > a')[0]
returns a
DOM
HTML Object and NOT a jQuery Object. attr() does not exist on a
DOM
node.
One option is to change your selector to use
:eq(0)
or you can do
$('div#contactEmail > a').eq(0).attr()
Eric
Naveen puttu
Ranch Hand
Joined: Sep 15, 2009
Posts: 88
posted
Feb 19, 2010 12:01:03
0
thanks for the reply eric
i get totally confused about this
DOM
and jquery . when would i get which object , thatz the question i always ponder upon
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56549
14
I like...
posted
Feb 19, 2010 12:27:22
0
It's simple: if you want to use
DOM
methods, get the
DOM
element. If you want to use jQuery methods, don't.
Stop and think about what the expressions that you are using
mean
-- don't just parrot syntax.
[
Smart Questions
] [
JSP FAQ
] [
Books by Bear
] [
Bear's FrontMan
] [
About Bear
]
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56549
14
I like...
posted
Feb 19, 2010 12:28:32
0
Naveen puttu wrote:
thatz the question i always ponder upon
Please
UseRealWords
when posting to the fotums.
Naveen puttu
Ranch Hand
Joined: Sep 15, 2009
Posts: 88
posted
Feb 19, 2010 12:33:54
0
Sorry bear
I agree. Here's the link:
http://aspose.com/file-tools
subject: child node issue
Similar Threads
Uneven spaces between tables
100% height does not work
Page Break problem in Mozilla
how to get HTML div id name from RootPanel
Spring MVC Request Mapping
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter