title: Bold font when clicked
body: <p>I am trying to make the text turn bold when it is clicked and when it is clicked again it will return to normal. Function addBord(e) is what I got so far but I am not sure if I am on the right track or what I should do next. Can anyone give me an idea on what to do next?    </p>
  
  <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN“ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
  &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
  &lt;head&gt;
    &lt;meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /&gt;
    &lt;title&gt;Address Book&lt;/title&gt;
  
    &lt;script type="text/javascript"&gt;
      function addressBookItem (fname, lname, email) {
          this.fname= fname;
          this.lname = lname; 
          this.email = email;
      }
  
      addressBookItem.prototype.write = function() {
          // var adrbook = "&lt;p class='ab' First Name: " + this.fname + "&amp;ltbr /&amp;gt";
          var adrbook = "&lt;tr&gt;&lt;td&gt;"+ this.fname + "&lt;/td&gt;";
          adrbook += "&lt;td&gt;" + this.lname + "&lt;/td&gt;";
          adrbook += "&lt;td&gt;" + this.email + "&lt;/td&gt;&lt;/tr&gt;";
  
          document.write(adrbook);
      }
  
    function appendRow() {
      var theTable = document.getElementById("addressBookTbl");
      // create a newRow
      var newRow = document.createElement("tr");
      var c1 = document.createElement("td");
      var c2 = document.createElement("td");
      var c3 = document.createElement("td");
      var v1 = document.createTextNode(prompt("Please enter first name"));
      var v2 = document.createTextNode(prompt("Please enter last name"));
      var v3 = document.createTextNode(prompt("Please enter email"));
      c1.appendChild(v1);
      c2.appendChild(v2);
      c3.appendChild(v3);
      // newRow &lt;- c1;
      newRow.appendChild(c1);
      newRow.appendChild(c2);
      newRow.appendChild(c3);
      theTable.appendChild(newRow);
      newRow.style.color="green";
    }
    newRow.addEventListener('click', addBord, false);
    function addBord(e) { 
      var target = e.target || event.srcElement;
      if(target.style.fontWeight=="bold")
        target.style.fontWeight="normal";
      else
        target.style.fontWeight="bold";
    }
  &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;script type="text/javascript"&gt;
          var aB1 = new addressBookItem('Roger', 'Williams', 'rwilliams@gmail.com');
          var aB2 = new addressBookItem ('Rose', 'Schultz', 'rose_s@earthlink.net');
          document.write("&lt;table id=\"addressBookTbl\" border=\"2\"&gt;&lt;tr&gt;&lt;th&gt;First Name&lt;/th&gt;&lt;th&gt;Last Name&lt;/th&gt;&lt;th&gt;EmailAddress&lt;/th&gt;&lt;/tr&gt;");
          aB1.write();
          aB2.write();
          document.write("&lt;/table&gt;");
      &lt;/script&gt;
      &lt;form&gt;
        &lt;br /&gt;
        &lt;input type="button" value="append new row" onclick="appendRow()"/&gt;
      &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>