Disable submit functionality for all forms on a HTML page

前端 未结 8 1525
轻奢々
轻奢々 2021-01-02 00:04

Using the .NET Windows Forms WebBrowser control to show the preview of a page, I\'m using the following approach described in this SO posting to disable all links on the pag

8条回答
  •  难免孤独
    2021-01-02 00:45

    using jquery i would do this

    $('form').submit(function(event){event.preventDefault();});
    

    with jquery you normally dont use .attr(...) to bind event listeners instead you should use the helper methods, or .bind(...)

    here its the complete reference: jQuery events

提交回复
热议问题