Why is my onclick event not registered in Firefox?
问题 I have a list item with an onclick event. It runs in Chrome and Internet Explorer, but not Firefox. Any suggestions? <li onclick="alert('test');">test test<br></li> 回答1: This works fine for me in Firefox. Check this: JavaScript is enabled in your browser. Try adding a return false; statement in your tag. Or a function like this: function test() { //your code here return false; } Or use this: <a href="#" onclick="alert('hi');">Link</a> or this <a href="javascript:void(0)" onclick="alert('hi');