Selecting a specific Child of the parent element

Vishalneeraj-24503
Posted by Vishalneeraj-24503 under jQuery category on | Points: 40 | Views : 974
To select a specific child of the parent element,nth child selector can be used.

<script language = "javascript" type = "text/javascript">
$("#div_project p:nth-child(5)").css("background", "green");
</script>

Note:- Above jQuery code will select the 5th paragraph(p) element that is inside the div_project element.

Comments or Responses

Login to post response