怎么把這段代碼?$(document).ready(function(){? $("button").click(function(){? $(this).hide();寫到.js文件中 ?然后使用 ?<html><head><script type="text/javascript" src="/jquery/jquery.js"></script><script type="text/javascript">$(document).ready(function(){? $("button").click(function(){? $(this).hide();});});</script></head><body><button type="button">Click me</button></body></html>
1 回答
已采納

慕勒0069038
TA貢獻143條經驗 獲得超39個贊
xxx.js =>
document.write('<script type="text/javascript" src="/jquery/jquery.js"></script>></script>');
$(document).ready(function(){
? $("button").click(function(){
? $(this).hide();
xxx.html =>
<html>
<head>
<script type="text/javascript" src="/xxx.js"></script>
</head>
<body>
<button type="button">Click me</button>
</body>
</html>
是這個意思吧
點擊展開后面1條
- 1 回答
- 0 關注
- 2375 瀏覽
相關問題推薦
添加回答
舉報
0/150
提交
取消