Stop form submit with native javascript

后端 未结 3 683
粉色の甜心
粉色の甜心 2020-12-21 21:25

I need to select a form via native javascript (not jQuery) and prevent the form submission (preventDefault).

The trick is that the form does not have a name or id, a

3条回答
  •  攒了一身酷
    2020-12-21 22:03

    Simple way is use onsubmit event handler

    
    
    
    ....

    or more easy

提交回复
热议问题