随笔分类 - JS
摘要:转载至 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.
阅读全文
摘要:Title 一级菜单 二级菜单 二级菜单 二级菜单 一级菜单 二级菜单 二级菜单 二级菜单 ...
阅读全文
摘要:示例 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 <!DOCTYPE html> <html> <head> <title>访问元素</title> <meta c
阅读全文
摘要:兄弟元素查找比较坑,只是能元素在同一行时才能查询。 查询子节点 firstChild lastChild 示例 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 <!DO
阅读全文
摘要:按元素标签查询多个 getElementsByTagName 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 <!DOCTYPE html> <html> <head> <title>访
阅读全文
摘要:示例 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 <!DOCTYPE html> <html> <head> <title>访问元素</title> <meta charset="U
阅读全文
摘要:示例2 查询多个元素 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 <!DOCTYPE html> <html> <head> <title>访问元素</title> <meta ch
阅读全文
摘要:按CSS查询 示例1 查询一个 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 <!DOCTYPE html> <html> <head> <title>访问元素</title> <me
阅读全文
摘要:示例 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 <!DOCTYPE html> <html> <head> <title>访问元素</title> <meta charset="UTF-8"> <m
阅读全文
摘要:JavaScript 查找元素 查询单个元素document.getElementById 示例 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 <!DOCTYPE html> <html> <head>
阅读全文
摘要:1.打开:http://kindeditor.net/ke4/examples/default.html 2.查看源代码,另存为 3.打开http://kindeditor.net/demo.php,点击右上角的下载按钮下载源码 4.将lang,plugins,themes,kindeditor-a
阅读全文
摘要:1.打开https://getbootstrap.com/docs/4.3/examples/checkout/复制表单源码 2.清空main标签内容 3.粘贴表单源码 4.示例图
阅读全文
摘要:1.打开https://getbootstrap.com/docs/4.3/examples/ 2.选择Dashboard 3.右键查看源代码,另存为 4.通过源代码界面下载JS和CSS 5.修改绝对路径为相对路径 6.成功截图
阅读全文
摘要:1.打开http://jqueryui.com/ 2.在左侧菜单栏Widgets下的tabs 3.在Examples下,选择Open on mouseover 4.点view source 5.复制代码 6.在代码第7和第8行的href前面加上http 7.运行示例
阅读全文
摘要:了解表达式中的短路值。 逻辑运算从左到右。逻辑或运算,当左边的条件成立时,后面的条件将不再参与运算。因此在逻辑或运算中,尽量将条件结果为true的放第一位。而在逻辑与运算中,尽量将条件结果为false的放到第一位。 示例 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
阅读全文
摘要:了解常见的真值和假值,可以增强判断能力。在使用if判断时,提升编码速度。 了解常见的检测和存在,一样可以增强判断能力,而且是必须掌握的。 数组和对象被视为真值 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 var shoppingCart=['鞋','连衣
阅读全文
摘要:jquery-validation是一款前端验证js插件,可以验证必填字段、邮件、URL、数字范围等,在表单中应用非常广泛。 官方网站 https://jqueryvalidation.org/ 下载地址:https://github.com/jquery-validation/jquery-val
阅读全文
摘要:smoothscroll是一款jQuery插件,可以平滑地滚动到指定的地方。 可以解决chrome锚点失效的问题。 官方网站 http://iamdustan.com/smoothscroll/ github地址 https://github.com/iamdustan/smoothscroll h
阅读全文