jquery attribute! = value selector syntax
Action: [! Attribute = value] Each element of the selector to select the specified attribute and without value. With the specified properties, but without the specified element value, it will be selected.
Syntax: $ ( "[attribute = value!]")
Parameters: attribute required. The provisions of property you are looking for. value Required. To find the specified value. Linear Motor
jquery attribute! = value selector Example
<html> <head> <script type="text/javascript" src="http://apps.bdimg.com/libs/jquery/2.1.1/jquery.min.js"></script> <script type="text/javascript"> $(document).ready(function(){ $("body [id!=main_header]").css("background-color","#B2E0FF"); }); </script> </head> <body> <html> <body> <h1 id="main_header">Welcome to My Homepage</h1> <p class="intro">My name is Donald</p> <p>I live in Duckburg</p> <p>My best friend is Mickey</p> <h3 id="sub_header">My uncle is Scrooge</h3> <div id="choose"> Who is your favourite: <ul> <li>Goofy</li> <li>Mickey</li> <li>Pluto</li> </ul> </div> </body> </html> </body> </html>