title: onfocus not working in javascript
body: <p>i am putting together some javascript form validation and i cant figure out how to get this onfocus to take hold of my div... i just need it to alert me that my onfocus function is making contact with my last name imput... :(</p>
  
  <p>html:</p>
  
  <pre><code>&lt;div id="contact"&gt;
      &lt;form name="form1" action="send.php" method="post" id="contact_f"&gt;
        &lt;table id="contact_table"&gt;
          &lt;tr&gt;
            &lt;td class="col1" colspan="2"&gt;
              &lt;h1 class="center_text"&gt;Contact Aron&lt;/h1&gt;
              &lt;div id="error_messages"&gt;
                errors
              &lt;/div&gt;
            &lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
            &lt;td class="col1"&gt;
              &lt;label for="first_name"&gt;First Name*&lt;/label&gt;&lt;br&gt;
              &lt;input id="first_name" required name="Name" type="text" pattern="[a-zA-Z]+"&gt;
            &lt;/td&gt;
            &lt;td class="col2"&gt;
              &lt;label for="last_name"&gt;Last Name*&lt;/label&gt;&lt;br&gt;
              &lt;input id="last_name" required type="text"&gt;
            &lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
            &lt;td class="col1"&gt;
              &lt;label for="email"&gt;Email*&lt;/label&gt;&lt;br&gt;
              &lt;input id="email" required type="email"&gt;
            &lt;/td&gt;
            &lt;td class="col2"&gt;
              &lt;label for="confirm_email"&gt;Confirm Email*&lt;/label&gt;&lt;br&gt;
              &lt;input id="confirm_email" required type="text"&gt;
            &lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
            &lt;td class="col1"&gt;
              &lt;label for="phone"&gt;Phone Number   &lt;span id="color_gray"&gt;xxx-xxx-xxxx&lt;/span&gt;&lt;/label&gt;&lt;br&gt;
              &lt;input id="phone" type="tel" pattern="\d{3}[\-]\d{3}[\-]\d{4}"&gt;
            &lt;/td&gt;
            &lt;td class="col2"&gt;
  
            &lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr class="col2"&gt;
            &lt;td class="col1" colspan="2"&gt;
              &lt;label for="message"&gt;Message*&lt;/label&gt;&lt;br&gt;
              &lt;textarea id="message" required type="text"&gt;&lt;/textarea&gt;
            &lt;/td&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
            &lt;td class="col1" colspan="2"&gt;
              &lt;button id="submit_button" type="submit" value="submit"&gt;Submit Form&lt;/button&gt;
            &lt;/td&gt;
          &lt;/tr&gt;
        &lt;/table&gt;
    &lt;/form&gt;
  </code></pre>
  
  <p>javascript in question:</p>
  
  <pre><code>    document.getElementById("last_name").onfocus=function() {
        alert("last name");
      };
  </code></pre>