Select every element containing an id attribute with the value “choose”
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript"
src="lib/jquery/jquery-1.3.2.js">
</script>
<script type="text/javascript">
$(document).ready(function(){
$("[id=choose]").css("background-color", "red");
});
</script>
</head>
<body>
<h1>This is header</h1>
Who is your favourite:
<ul id="choose">
<li>aaa</li>
<li>ccc</li>
<li>bbb</li>
</ul>
</body>
</html>
Comments
Post a Comment