I'm beginner with Javascript. I've tried to hide a form with no luck.
Where is the error ?
http://jsfiddle.net/6EWCe/5/
<div id="form1">
<form>
First name: <input type="text" name="firstname"><br>
Last name: <input type="text" name="lastname">
</form>
</div>
<div id="form2">
<form>
First name:2 <input type="text" name="firstname"><br>
Last name:2 <input type="text" name="lastname">
</form>
</div>
<a href="#" onclick="hideform()">Close</a>
function hideform() {
document.getElementById('form2').style.display = 'none';
}
Uncaught ReferenceError: hideform is not defined
...is your error.
You need to specify that you want your JavaScript to load in the body of your JSFiddle demo using the options in the sidebar:

Fixed JSFiddle demo.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With