title: Html/Javascript - Onfocus event
body: <p>So, I am attempting to ensure that the page I am working on works cross browser and to do this I have attempted to call the 'onfocus' event within <code>&lt;script&gt;</code> tags - Unfortunately what I have tried isn't working and currently I am unsure why. Any advice/feedback would be appreciated.</p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;input name="searchField" placeholder="Search users" type="text" size="60"
      maxlength="150" id="SearchBox" style="margin-top:15px; height:auto;" /&gt;
  
  &lt;script type="text/javascript"&gt;
      if (!("placeholder" in document.createElement("input"))) {
          document.getElementsByName("searchField")[0].value = 'Search users';
          document.getElementsByName("searchField")[0].onfocus =
              'document.getElementsByName("searchField")[0].value="";';
      }
  &lt;/script&gt;
  </code></pre>