Checkbox to change font weight not working - Javascript
<p>I need to insert a checkbox into a form to change the font weight of text in a div. </p>

<p>My javascript is as follows:</p>

<pre><code>function boldText(checkBox,target) { 
  if(checkBox.checked){ 
    document.getElementById("lineOne").style.fontWeight = "bold"; 
  }
  else { 
    document.getElementById("lineOne").style.fontWeight = "normal"; 
  } 
}
</code></pre>

<p>And my html like so:</p>

<pre><code>&lt;input type="checkbox" onclick="boldText(this,textToBold)"&gt; 
&lt;div id="lineOne"&gt;Change text to bold&lt;/div&gt;
</code></pre>

<p>What is wrong here. I cant seem to get it to work.</p>
