Ask Question Forum:
Model Library:2025-02-08 Updated:A.I. model is online for auto reply question page
C
O
M
P
U
T
E
R
2
8
Show
#
ASK
RECENT
←
- Underline
- Bold
- Italic
- Indent
- Step
- Bullet
- Quote
- Cut
- Copy
- Paste
- Table
- Spelling
- Find & Replace
- Undo
- Redo
- Link
- Attach
- Clear
- Code
Below area will not be traslated by Google,you can input code or other languages
Hint:If find spelling error, You need to correct it,1 by 1 or ignore it (code area won't be checked).
X-position of the mouse cursor
Y-position of the mouse cursor
Y-position of the mouse cursor
Testcursor
caretPos
Attachment:===
Asked by coolispaul
at 2024-07-25 01:40:15
Point:500 Replies:4 POST_ID:829097USER_ID:11996
Topic:
jQuery;Hypertext Markup Language (HTML);Cascading Style Sheets (CSS)
Hi,
I want to apply a click event to all child list items in an undordered list other than the first child. how can i achieve this?
Thanks
I want to apply a click event to all child list items in an undordered list other than the first child. how can i achieve this?
Thanks
Expert: duncanb7 replied at 2024-07-25 02:57:56
Thanks for your points and all code for jquery
Have a nice day
Duncan
Have a nice day
Duncan
$("#top li:not(:first-child)").click( function() { $(this).css("color","green"); alert( $(this).text() );} ); 1:2:3:4:5:6:
Author: coolispaul replied at 2024-07-25 02:54:24
thats the one
great thanks
great thanks
Accepted Solution
Expert: duncanb7 replied at 2024-07-25 02:51:43
500 points EXCELLENT
Do want to click to all its child nodes besides first child node ? If so, see the following code
Duncan
Duncan
$("#top li:not(:first-child)").click( function() { this.style.color="green" alert( "Clicking" );} );<ul id='top'> <li>First item</li> <li>Second item</li> <li>Third item</li></ul> 1:2:3:4:5:6:7:8:9:10:11:12:
Expert: aboo_s replied at 2024-07-25 01:53:46
Try The nextSibling property, which returns the node immediately following a given node!