hi all
i have code below like this in jquery
i am geting out put alert("hi and bye");
code:
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script>
$(document).ready(function () {
var g = {
a: "ram", d: function () { alert("hi and bye"); }
}
$("#hide").click(g.d());
});
</script>
</head>
<body>
<p>If you click on the "Hide" button, I will disappear.</p>
<button id="hide">Hide</button>
</body>
</html>
but this out put i am geting while loading ,
i did not click the button,
so what is reason.