I'm going through the WC3 javascript and DOM tutorials and stuck how some of this applies to <ul>'s
can someone tell me why this doesn't change the first <li> to bold? I'd like to be able to target specific <li>'s and make them bold or change the font-face.
can someone tell me why this doesn't change the first <li> to bold? I'd like to be able to target specific <li>'s and make them bold or change the font-face.
Code:
<html>
<head>
<SCRIPT type="text/javascript">
function ChangeText(){
document.getElementById("findMe").firstChild.style.fontWeight="bold";
}
</SCRIPT>
</head>
<body>
<input type="button" onclick="ChangeText()" value="Change text" />
<div >
<ul id="findMe">
<li>A. Introduction</li>
<li>A. 1 Upland and Terrestrial Ecosystems</li>
<li>A.2 Freshwater Ecosystems</li>
<li>A.3 Marine and Marine Nearshore Ecosystems</li>
<li>A.4 Improve Protection Tools</li>
<li>A.5 Science Related Strategies and Actions</li>
</ul>
</div>
</body>
</html>
Comment