title: How do I call javascript from asp.net button click?
body: <p>I'm working on asp.net and want to execute following javascript code.
  I'm using VS2010.</p>
  
  <pre><code>   &lt;title&gt;&lt;/title&gt;
  &lt;script type="text/javascript"&gt;
      function myClosure() {
          var canyousee = "here I'm ";
          return (function theClosure() {
              return { canyouseeIt: canyousee ? "yes" : "no" };
          });
      }
      var closure = myClosure();
      closure().canyouseeIt;
  &lt;/script&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
      &lt;form id="form1" runat="server"&gt;
      &lt;div&gt;
          &lt;asp:Button ID="Button1" runat="server" Text="Button" OnClientClick="myClosure();" /&gt;
      &lt;/div&gt;
  </code></pre>
  
  <p>How do i execute <code>function myClosure()</code> on button click so that It gives me <code>confirm</code> i.e popup for <code>yes</code> or <code>no</code> ?</p>
  
  <ol>
  <li>Which code I need to put for <code>confirm</code> ?</li>
  <li>How can I execute it on <code>Button Click</code> ? </li>
  </ol>
  
  <p>thanks </p>