Jquery first child

Posted on 2014-07-25
Last Modified: 2014-07-25

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?

Question by:coolispaul
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
LVL 10

Expert Comment

ID: 40218801
Try The nextSibling property, which returns the node immediately following a given node!
LVL 13

Accepted Solution

duncanb7 earned 500 total points
ID: 40219010
Do want to click to all its child nodes besides first child node ? If so, see the following code

  $("#top li:not(:first-child)").click(
  function() {"green"
  alert( "Clicking" );

<ul id='top'>
 <li>First item</li>
 <li>Second item</li>
 <li>Third item</li>

Open in new window


Author Comment

ID: 40219016
thats the one

great thanks
LVL 13

Expert Comment

ID: 40219024
Thanks for your points and all code for jquery

Have a nice day

$("#top li:not(:first-child)").click(
  function() {
  alert( $(this).text() );

Open in new window


Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
This article discusses how to implement server side field validation and display customized error messages to the client.
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

710 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question