19-1.js

来自「js 全的样例代码,比较适合大家学习和交流」· JavaScript 代码 · 共 17 行

JS
17
字号
// This function is suitable for use as an onclick event handler for <a> and// <area> elements.  It uses the this keyword to refer to the document element,// and may return false to prevent the browser from following the link.function confirmLink() {  return confirm("Do you really want to visit " + this.href + "?");}// This function loops through all the hyperlinks in a document and assigns// the confirmLink function to each one as an event handler.  Don't call it// before the document is parsed and the links are all defined.  It is best// to call it from the onload event handler of a <body> tag.function confirmAllLinks() {  for(var i = 0; i < document.links.length; i++) {    document.links[i].onclick = confirmLink;  }}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?