I am trying o learn jQUERY , i am trying with different types of things in jquery . I got this query , on click of a button , i am using the click funcion of a button to call another function , as shown .
But this isn't working .
Could you please tell me , cant we use the click this way
$("button").click() instead of standard $("button").click(function(){
=====
This is my code
<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()
{
callMe();
}
});
function callMe()
{
$("p").hide();
}
</script>
</head>
<body>
<h2>This is a heading</h2>
<p>This is a paragraph.</p>
<p>This is another paragraph.</p>
<button>Click me</button>
</body>
</html>