Suppose I have the following html:
<div id="test1">hi</div>
<a href="#" onclick="showDiv()">click here</a>
and the javascript:
function showDiv() {
$("#test1").hide();
}
When I try it on jsfiddle, it returns:
$ is not defined
Did I miss some setting in jsFiddle?
Thanks.
JSFiddle is an online IDE service and online community for testing and showcasing user-created and collaborational HTML, CSS and JavaScript code snippets, known as 'fiddles'. It allows for simulated AJAX calls.
Fork will split out an existing fiddle into a new one, starting with version 0.
Click on your profile -> dashbord : http://jsfiddle.net/user/dashboard/ then select your saved code. So simple.
That suggests that you have not selected one of the jQuery libraries from the left hand side of the screen.
These answers are old and for anyone looking for an updated version the dropdown menu is now located on the gear next to the word Javascript at the top right of your javascript window in jsfiddle.
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