title: jQuery in an ASP.net MVC application using Master Pages
body: <p>I am trying to get simple jQuery to execute on my Content page with no luck below is what I am trying to do:</p>
  
  <pre><code>&lt;asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server"&gt;
  
     &lt;script src="../../Scripts/jquery-1.2.6.js" type="text/javascript"&gt;&lt;/script&gt;
     &lt;script type="text/javascript"&gt;
  
         $(document).ready(function() {
             alert("hi");
         });   
     &lt;/script&gt;
  
  &lt;/asp:Content&gt;
  </code></pre>
  
  <p>I have also tried getting the following to work:</p>
  
  <pre><code>&lt;asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server"&gt;
  
     &lt;script src="../../Scripts/jquery-1.2.6.js" type="text/javascript"&gt;&lt;/script&gt;
     &lt;script type="text/javascript"&gt;
         function onload()
         {
            $("#myDiv").css("border", "1px solid green");
         }
     &lt;/script&gt;
  
     &lt;div id="myDive"&gt;
        Hello
     &lt;/div&gt;
  
  &lt;/asp:Content&gt;
  </code></pre>