为某个元素插入值,添加属性,添加子元素 1 2 4 1 var parent = document.getElementById("creategood_store"); 2 var node = document.createElement("option"); 3 node.setAttribu... ...
分类:
Web程序 时间:
2018-10-30 17:17:51
阅读次数:
164
摘要: 1.td赋值 innerTEXT; 1.1 $("#ID").text(值); jQuery用法 1.2 document.getElementById('aa').inneText=inner; js用法 2.div赋值 innerHTML; 2.1 $("#aa").HTML(值); j ...
分类:
其他好文 时间:
2018-10-28 20:49:13
阅读次数:
230
手机号码正则表达式验证: function checkPhone(){ var phone = document.getElementById('phone').value; if(!(/^1[34578]\d{9}$/.test(phone))){ alert("手机号码有误,请重填"); ret ...
分类:
移动开发 时间:
2018-10-28 18:04:52
阅读次数:
1099
在javascript中,document.write()方法;常用来网页向文档中输出内容。 示例:通过document.write()方法,向网页文档中输出了一段文字。 document.write("我爱学习--喜欢学习。");此外,还可以以另一种方式通过document.write()方法来输 ...
分类:
其他好文 时间:
2018-10-28 16:51:30
阅读次数:
144
1. 函数都有返回值…… 而方法的本质也是函数,所以也有返回值。 Document.getElementById() 返回的是获取的标签 getElementsByClassName()和getElementsByTagName()返回的是一个数组 Document.getElementsByCla ...
分类:
其他好文 时间:
2018-10-25 20:16:51
阅读次数:
151
Dom对象 Dom对象的全称是:Document Object Model Dom主要研究html 中的节点(标签)对节点进行操作,改变标签属性,改变css样式,添加事件等, Dom研究的对象是document 操作流程: 1、选择你要操作的节点 document . getElementById( ...
分类:
其他好文 时间:
2018-10-25 17:05:27
阅读次数:
102
来源: DOM(文档对象模型)是w3c国际组织的一套web标准。 方法: getElementById() :返回带有指定 ID 的元素。 getElementsByTagName():返回包含带有指定标签名称的所有元素的节点列表(集合/节点数组)。 getElementsByClassName() ...
分类:
Web程序 时间:
2018-10-25 14:08:48
阅读次数:
223
利用input的checked属性来实现:checked值为true,表示被选择,否则反之。 效果如图: js代码: 1.通过var butt1 = document.getElementById("butt1")来获取对应的id元素。 2.butt1.onclick = function(){ } ...
分类:
编程语言 时间:
2018-10-25 12:03:56
阅读次数:
114
一.函数都有返回值…… 而方法的本质也是函数,所以也有返回值。 Document.getElementById() 返回的是获取的标签 getElementsByClassName()和getElementsByTagName()返回的是一个数组 Document.getElementsByClas ...
分类:
其他好文 时间:
2018-10-24 22:24:14
阅读次数:
148
$("#btnapply").click(function(){ file = document.getElementById("image"); var file=file.files[0]; var fileName=file.name; getbase64(file) $("#img").at ...
分类:
其他好文 时间:
2018-10-24 16:07:33
阅读次数:
468