title: UpdatePanel and Javascript
body: <p>I have inline script such as this, which toggles between an edit and a display divs. If it is inside the the UpdatePanel it requires two click before it works. If I remove the UpdatePanel it works fine with a single click.</p>
  
  <pre><code>&lt;a href="#" onclick="edit(event,'ctl00_CPH1_ctl00_win1')"&gt;Edit&lt;/a&gt;
  </code></pre>
  
  <p>Can anyone help please?</p>
  
  <p>Thanks</p>
  
  <p>EDIT:
  Edit function:</p>
  
  <pre><code>function edit(e, id) {
      var editdiv = $('#' + id).find('.edit');
      var cntdiv = $('#' + id).find('.content');
  
      if (editdiv.css('visibility') == 'hidden') {
          editdiv.css('visibility') == 'visible'
          cntdiv.css('visibility') == 'hidden'
          cntdiv.hide();
          editbox.show()
      }
      else {
          editdiv.css('visibility') == 'hidden'
          cntdiv.css('visibility') == 'visible'
          cntbox.show();
          editbox.hide()
      }
  
      stopEventBubble(e); // Code to cancel event bubbling;
  }
  </code></pre>