title: Adding an onclick function to go to url in JavaScript?
body: <p>I am using this fancy little JavaScript to highlight a field as the user hovers over it. Could you please tell me if there is a way of adding an <code>onclick</code> function which will act as a link and go to a URL?</p>
  
  <pre><code>&lt;script&gt;
           $(function() {
              $('tr').hover(function() {
                  $(this).css('background-color', '#eee');
                  $(this).contents('td').css({'border': '0px solid red', 'border-left': 'none', 'border-right': 'none'});
                  $(this).contents('td:first').css('border-left', '0px solid red');
                  $(this).contents('td:last').css('border-right', '0px solid red');
              },
              function() {
                  $(this).css('background-color', '#FFFFFF');
                  $(this).contents('td').css('border', 'none');
                  $('a#read_message.php').click(function(){ URL(); });
              });
          });
          &lt;/script&gt;
  </code></pre>