Javascript examples for jQuery Method and Property:not
Remove another jQuery selection from the selected elements
<!DOCTYPE html> <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <script> $(document).ready(function(){ $("p").not($("div p.intro")).css("color", "red"); });// ww w . jav a2 s.c om </script> </head> <body> <div style="border:1px solid black;"> This is a div element <h1>Welcome to My Homepage</h1> <p>test</p> <p class="intro">test(this p element will be removed from the group).</p> <p>test</p> </div> <p class="intro">here</p> <p>This p element is outside the div element.</p> </body> </html>