problem description
A simple click of a button triggers the pop-up window function, and the conceptual details of the code are a little confusing
related codes
/ / method 1:
<script>
function f1() {
alert("");
}
</script>
<input type="button" value="" onclick="f1()"/> <!--f1()-->
method 2:
<input type="button" value="" id="btn" />
<script>
function f2() {
alert("htmljs");
}
function f2() {
alert("");
}
var btnObj=document.getElementById("btn");
//
btnObj.onclick=f2;//
</script>