摘要: <body> <!-- 获取元素的值 获取表单元素的值 表单元素节点.value; 取值 表单元素节点.value = "值"; 设置值 文本框,密码框,单选,多选 获取非表单元素的内容 元素节点.innerHtml = "值"; 设置值 元素节点.innerHtml; 取值 获取input元素 1 阅读全文
posted @ 2022-01-25 17:30 码农阿亮 阅读(350) 评论(0) 推荐(0) 编辑
摘要: 一、Html事件处理程序 弊端:与标签耦合度太高,直接绑定在标签体上 <body> <button type="button" onclick="alert('消息框');" onmouseout="console.log('控制台')">Html事件处理程序</button> <button ty 阅读全文
posted @ 2022-01-25 17:21 码农阿亮 阅读(34) 评论(0) 推荐(0) 编辑
摘要: 1、document.表单名称 2、document.getElementById(表单 id); 3、document.forms[表单名称] 4、document.forms[索引]; //从 0 开始 <body> <!-- 获取表单 1、document.表单名称 2、document.ge 阅读全文
posted @ 2022-01-25 17:02 码农阿亮 阅读(326) 评论(0) 推荐(0) 编辑
摘要: Function //格式化时间 function format(dat){ //获取年月日,时间 var year = dat.getFullYear(); var mon = (dat.getMonth()+1) < 10 ? "0"+(dat.getMonth()+1) : dat.getMo 阅读全文
posted @ 2022-01-25 08:38 码农阿亮 阅读(518) 评论(0) 推荐(0) 编辑