<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<input type="button" value="anniu" id="btn" name="">
<script type="text/javascript">
var btn=document.getElementById("btn");
function st(){
alert("sd")
}
btn.onclick=st;
</script>
</body>
</html>
When is written as btn.onclick=st ();
, the page opens and alert pops up directly. Why? How does this work?