In my javascript file, I define clear as such:
function clear() {
document.imp1.value = 0
document.imp2.value = 0
}
I'm unsure about the syntax of that, but that is not the issue here (although if it is wrong, I'd appreciate a bit of help in that too.) My issue is that whenever I press the button clear, as defined:
<div id="calc">
<form name="calc_input">
<input type="text" id="imp1" value="0"/>
<input type="text" id="imp2" value="0"/>
<!-- buttons -->
<button type="button" onclick="clear()" id="clear">Clear</button>
</form>
</div>
I get an an error telling me that "clear" is not a function. Any ideas?
Edit: It turns out clear was conflicting with another built-in function, I renamed it to clr and it works.