Loading...
Copy code
Close
Permalink
Close
Please tell us why you want to mark the subject as inappropriate.
(Maximum 200 characters)
Report Inappropriate
Cancel
Private Message
From :
guest
To :
Subject :
Content :
Type the characters you see in the picture below.
Send
Cancel
From :
guest
To :
Subject :
Content :
Type the characters you see in the picture below.
Send
Update
Cancel
Feedback
Email ID
Subject :
Comments :
Send
Cancel
Private Message
Type the characters you see in the picture below.
Type the characters you see in the picture below.
Attach files
Desktop
Google Docs
Each Attachment size should not exceed 1.0 MB.
Max no of attachments : 3
Loading User Profile...
guest
Response title
This is preview!
Attachments
Publish
Back to edit
Cancel
(
)
Sign In
New to this Portal? Click here to
Sign up
You can also use the below options to login
Login with Facebook
Login with Google
Login with Yahoo
jQuery
Plugins
UI
Meetups
Forum
Blog
About
Donate
All Forums
Recent Posts
Log In
Search
jQuery
Search
jQuery Forum
Move this topic
Forum :
Getting Started
Using jQuery
Using jQuery Plugins
Using jQuery UI
Developing jQuery Core
Developing jQuery Plugins
Developing jQuery UI
QUnit and Testing
About the jQuery Forum
jQuery Conferences
jQuery Mobile
Developing jQuery Mobile
Sub forum :
Move this topic
Cancel
Using jQuery
ashkan.ar..
finding a span nested inside another span?
in
Using jQuery
•
11 years ago
If you have span within another span, jQuery selector seems to be unable to find it.
example:
<
span
>
<
span
class
="
paginate_active
"
>
1
</
span
>
<
span
class
="
paginate_button
"
>
2
</
span
>
<
span
class
="
paginate_button
"
>
3
</
span
>
<
span
class
="
paginate_button
"
>
4
</
span
>
<
span
class
="
paginate_button
"
>
5
</
span
>
</
span
>
If I do this after the above:
$("body").find("span").css("border","3px solid red");
Then it will only draw a border around the outer span, like this:
If give the outer span an Id and do replace body with #idofspan it doesn't make any difference either, it won't find spans inside.
Any idea whether this is a limitation/bug or am I doing something wrong?
1
Replies(2)
jay.blanc..
Re: finding a span nested inside another span?
11 years ago
Try:
$
(
"body"
)
.
find
(
"span > span"
)
.
css
(
"border"
,
"3px solid red"
)
;
It will find spans that are direct descendants of a span.
In your example it does work though, all spans are given a border including the nested spans.
Leave a comment on jay.blanchard's reply
kerry.kim..
Re: finding a span nested inside another span?
11 years ago
It seems to be working for me:
http://jsfiddle.net/kerrykimrusso/RH4Uf/2/
Leave a comment on kerry.kim.russo's reply
Change topic type
Topic Type :
Discussions
Questions
Ideas
Problems
No of days :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
Change topic type
Cancel
Link this topic
Provide the permalink of a topic that is related to this topic
Permalink
Save
Close
Reply to ashkan.aryan's question
Top
Reply
{"z7357416":[14737000002712694],"z7552670":[14737000002714182],"z5263876":[14737000002712692]}
Statistics
2
Replies
12059
Views
0
Followers
Tags
Cancel
span
jquery
selectors
Actions
Permalink