<html>
<head>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js" >
</script>
<script type="text/javascript">
$(document).ready(function(){
$("button").click(function()
{
callMe();
});
function callMe()
{
$("body .p").hide();
}
});
</script>
</head>
<body>
<h2>This is a heading</h2>
<p>This is a paragraph.</p>
<p>This is another paragraph.</p>
<h2>This is a heading2</h2>
<button>Click me</button>
</body>
</html>
Hi ,
I am new to Jquery , so please excuse if my questions are dumb .
Here i am trying to hide the P tags within the body ( On click of that submit button )
But this is no working .
could anybody please help me
Change the function to
Your mistake was here:
The
.pmeans any tag with a css-class namedp, nor a<p>tag.