Output disappeared Javascript simple innerHTML

后端 未结 3 1466
难免孤独
难免孤独 2021-01-13 03:01

I am new to javascript and on every simple thing i get some kind of problem but this seems un-solve-able to me. I googled and nothing simillar.

After i input data in

3条回答
  •  一整个雨季
    2021-01-13 03:31

    The

    tag doesn't specify an action attribute, so when you click the submit button, the browser will submit the form to the current URL - which will look a lot like the page is refreshing.

    If you want to run the unesi function when the user clicks submit and prevent the HTML form from submitting, you need to change it slightly:

    
    

    The return false prevents the form from submitting itself.

提交回复
热议问题