jQuery Tutorial
:not
':not' is used to exclude the specified element in the list of elements.
<html> <head> <title>The jQuery Example - To exclude particular elements</title> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <script type = "text/javascript"> $(document).ready(function(event) { $('p:not(:first)').css('color', 'blue'); }); </script> </head> <body> <p>line 0</p> <p>line 1</p> <p>line 2</p> <p>line 3</p> <p>line 4</p> <p>line 5</p> <p>line 6</p> </body> </html>Output:
$('p:not(:first)').css('color', 'blue');
Gets any other paragraph elements except the first paragraph elements.
« Previous Next » jQuery Tutorial
Privacy Policy | Copyright2020 - All Rights Reserved. | Contact us
| Report website issues in Github
| Facebook page
| Google+ page