HTML笔记:
1、document.querySelector("#demo")----获取文档中 id=“demo” 的元素练习地址
JavaScript笔记:
1、decodeURIComponent(URIstring) 函数----可对 encodeURIComponent() 函数编码的 URI 进行解码。练习地址
2、preventDefault() 方法&&stopPropagation() 方法----阻止元素的默认行为&&不再派发事件。练习地址
3、Window Location对象----用于获取当前页面地址(URL)并把浏览器重定向到新页面。练习地址
一些例子:
window.location.href 返回当前页面的 href (URL)
window.location.hostname 返回 web 主机的域名
window.location.pathname 返回当前页面的路径或文件名
window.location.protocol 返回使用的 web 协议(http: 或 https:)
window.location.assign 加载新文档
4、RegExp 对象----表示正则表达式,它是对字符串执行模式匹配的强大工具。练习地址 博客学习