今天无意识的看到了点击按钮弹出确认框的 javascript,原来如此简单,以前总以为很深奥,那是因为不敢下手去gle(google),不敢下手去du(baidu),所以酿此悲剧,见笑了。
so easy so 普遍的用法,贴个代码以后复习 :oops: :wink: :D
简单也实用,原来javascript有so many functions!
so easy so 普遍的用法,贴个代码以后复习 :oops: :wink: :D
<body>
<a href="http://www.baidu.com" onclick="return check()" >百度</a>
</body>
<script type="text/javascript">
function check() {
if (window.confirm("Are you sure you want to go to the Baidu?")) {
return true;
}
return false;
}
</script>
简单也实用,原来javascript有so many functions!