<html>
<head>
<meta charset="utf-8">
<title>Export to excel test</title>
<script src="./excellentexport.js"></script>
<script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.min.js"></script>
<style>
table,
tr,
td {
border: 1px black solid;
}
</style>
</head>
<body>
<h3>Test page</h3>
<div id="tablelist"></div>
</body>
<script src="./ajaxQuery.js"></script>
</html>
在head中引入外部资源库,body下引入与html相关的js代码段文件ajaxQuery.js如下(注意先后顺序)
test=document.getElementById('btn');
//给xx元素加事件
test.onclick=function(){
console.log('123')
}