HTML - How to do a Confirmation popup to a Submit button and then send the request?

后端 未结 5 1875
北海茫月
北海茫月 2020-12-04 19:22

I am learning web development using Django and have some problems in where to put the code taking chage of whether to submit the request in the HTML code<

5条回答
  •  执笔经年
    2020-12-04 19:37

    Use window.confirm() instead of window.alert().

    HTML:

    
    

    JavaScript:

    function clicked() {
        return confirm('clicked');
    }
    

提交回复
热议问题