Remove DOM object from selected elements - Javascript jQuery Method and Property

Javascript examples for jQuery Method and Property:not

Description

Remove DOM object from selected elements

Demo Code

ResultView the demo in separate window

<!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(document.getElementById("intro")).css("color", "red");
});/*from   ww  w .  j  a  va2  s .c o  m*/
</script>
</head>
<body>

<p>test</p>
<p id="intro">test</p>
<p>test</p>

</body>
</html>

Related Tutorials