button中的onclick写成函数时需要
<button onclick="return function();"></button>
加一个return,并且函数中,返回值需要是false,如果返回true页面会一直刷新
function myfunction(){ return false; }