Unwritten type=button on the button causes it to be submitted when clicked


There is a place very strange: click a popover button, did not think of popover disappeared, after the company’s js master debugging, found the mystery


<button class="btn btn_set_wj" onclick="add_q()"> Add questionnaire </button>

Just add a type =“button” :


<button class="btn btn_set_wj" type ="button" onclick="add_q()"> Add questionnaire </button>

Different browsers support different rules