title: Get ClientID in Javascript
body: <p>I have a javascript file that Select a button using jQuery and check it for validation.the code is:</p>
  
  <pre><code>$(document).ready(function () {
  $('#&lt;%= btn_Insert.ClientID %&gt;').on("click", function (event) {
  
      if (Validate() != true) {
          event.preventDefault();
      }
  });
  function Validate() {
      return (1 == 1);
  });
  </code></pre>
  
  <p>but I can' get <code>ClientID</code> for button and I get this Error:</p>
  
  <blockquote>
    <p>Object doesn't support this property or method</p>
  </blockquote>
  
  <p>where is my mistake?How I can get Client ID for a server side Button?</p>
  
  <p>thanks</p>
  
  <p><strong>EDIT 1)</strong></p>
  
  <p>When I add script in <code>head</code> part of page it works but when I write it to a JS file and add reference to it in <code>head</code> part it does not work</p>