
Hello Sir
I Have following code :
<ul> <li>First item</li> <li>Second item</li> <li>Third item</li> </ul>
And i need to add a class to 2nd & 3rd element or child as follows :
<ul> <li>First item</li> <li class="NewClass">Second item</li> <li class="NewClass">Third item</li> </ul>
Please reply with code.
Thank you in advance.

Its very simple Just use the following code line :
$("li:not(:first-child)").addClass("NewClass");
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.