View Full Version : onclick not working for link

10-04-2011, 11:26 PM
Hey guys, I have this JS.

function funcBut(){
document.getElementById('ref_button').innerHTML = 'pressed';

Now, this button activates the function with no problem:

<input type='button' onclick='funcBut();' value='Change Text'/><br />

But this link won't work and I don't understand why

<a href="#" onclick="funcBut(); return false;">test</a><br />

Can anyone help?

10-04-2011, 11:45 PM
I solved this please delete