如果确定JS没写错
第一种方法:
在JS方法最后return false; 调用方法前加上return
第二种方法:
在JS方法最后event.returnValue=false;
附加:event.returnValue=false和return false的区别
前者是取消事件的处理,而后者则是返回了一个false值如果只是简单地返回false值,并不会终止其触发元素的父级元素继续触发相同事件。而使用前者,则方法也就在此停止了。