Select all p elements NOT containing a class attribute with the value “intro”
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript"
src="lib/jquery/jquery-1.3.2.js">
</script>
<script type="text/javascript">
$(document).ready(function(){
$("p:[class!=intro]").css("background-color", "red");
});
</script>
</head>
<body>
<h1>This is header</h1>
<p class="intro">There is some text for paragraph</p>
<p>There is some text for paragraph</p>
<p>There is some text for paragraph</p>
</body>
</html>
Comments
Post a Comment