I just have copied a simple script from W3School and cannot get it running: Here it is:
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="http://Web Testing/js/jquery-1.8.0.min.js">
</script>
<script>
$(document).ready(function(){
$("p").click(function(){
$(this).hide();
});
});
</script>
</head>
<body>
<p>If you click on me, I will disappear.</p>
<p>Click me away!</p>
<p>Click me too!</p>
</body>
</html>
It works on their Tryit Editor with the following line but does not work even with this line on my Mac under BBEdit
you ned to include jquery the link you included is not working
try
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
also useing the google hosted libraries is a good option because many other website using it so in most case it will get in browser cache
<script src="http://code.jquery.com/jquery-1.8.3.min.js" type="text/javascript">
<!--left blank-->
</script>
<script type="text/javascript">
$(document).ready(function(){
/*Your code*/
});
</script>
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