Select all visible p elements: ($(“p:visible”))
<!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:visible").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