title: Set JavaScript events in WebBrowser control
body: <p>I have a WebBrowser control and try to set onclick and href attributes on all links.</p>
  
  <pre><code>foreach (HtmlElement link in webBrowser1.Document.Links)
  {
        link.SetAttribute("href", "http://www.google.com");
        link.SetAttribute("onclick", "return false;");
  }
  </code></pre>
  
  <p>It works well. When i out source code of outer html i see that attributes was exist.
  But JavaScript code does not work. Why and how i can force WebBrowser control to execute javascript code?</p>