This is really basic so sorry in advance for having to ask for help 😮
I’ve setup a simple page to play with jQuery but I can’t get a simple show/hide function to work.
Here’s my code..
<html>
<head>
<title>Testing Javascript/jQuery</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>
<script>
$(document).ready(function() {
$("div p").hide();
});
$("show").click(function(){
$("div p").show()
});
$("hide").click(function(){
$("div p").hide()
});
</script>
</head>
<body>
<button id='hide'>Click to hide the text</button>
<button id='show'>Click to show the text</button>
<div><p>you can't see me!</p></div>
</body>
</html>
Chromes developer tools give no error so im not sure where to look.
The text is initially hidden at first but the show and hide buttons do nothing.
Replace
with
so that jQuery looks for the element with id
show(and of course the same for$("hide")).