title: Javascript: Uncaught ReferenceError
body: <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;script type="text/javascript" src="https://code.jquery.com/jquery-1.11.3.js"/&gt;
  &lt;script type="text/javascript"&gt;
   $(document).ready(function(){
    $('#name').val('Name1');
   });
   function clickMe(){
    console.log('click me called');
   }
  &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
      Person Name: &lt;input type="text" id="name" data-bind="value:personName"&gt;
      &lt;input type="submit" value="Save" onClick="javascript:clickMe()"/&gt;
  &lt;/body&gt;
  
  &lt;/html&gt;
  </code></pre>
  
  <p>In the code above neither the function inside document.ready is getting executed nor "clickMe" function is getting executed when "Save" button is clicked.</p>
  
  <p>When I click on "Save" button, Uncaught ReferenceError: clickMe is not defined error message is seen.</p>