Reputation: 825
I am trying to make a calculator with Javascript, and I'm having a few problems... The code is at http://jsfiddle.net/NwkQW/10/.
<script type="text/javascript" src="mydomain.com/calculate.js></script>
), but if I try, it doesn't work right! HELP!!!Thanks!
Upvotes: 0
Views: 94
Reputation: 10377
Just change your totalDiv
to an input element and it will get cleared along with everything else. Or, don't rely on form reset and just clear everything in a method.
Upvotes: 0
Reputation: 7183
add a onClick to your clear form button like:
onClick="document.getElementById('totalDiv').innerHTML='';"
reset won't clear anything that's not a form element
see http://jsfiddle.net/NwkQW/16/
Upvotes: 1
Reputation: 5848
Add http://www. to the beginning of your source. You are trying to go to http://www.mydomain.com/mydomain.com/calculate.js assuming this file lives at /
Upvotes: 0
Reputation: 1745
<script type="text/javascript" src="http://www.mydomain.com/calculate.js"></script>
Upvotes: 1