87,914
社区成员
发帖
与我相关
我的任务
分享
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script src="./function.js" type="text/javascript"></script>
<script>
window.onload = function() {
abc();
};
</script>
</head>
<body>
<div id="div1"></div>
</body>
</html>
function.js
function abc() {
var d1 = document.getElementById('div1');
console.log(d1);
}