随笔分类 -  html

setAttribute()使用方法与IE兼容解决方法
摘要:我们经常需要在JavaScript中给Element动态添加各种属性,可以使用setAttribute()来实现,但涉及到了浏览器的兼容性问题。setAttribute(string name,string value):增加一个指定名称和值的新属性,或者把一个现有的属性设定为指定的值。1、关于class和classNameclass属性在W3C DOM中扮演着很重要的角色,但由于浏览器差异性仍然存在。使用setAttribute("class", vName)语句动态设置Element的class属性在firefox中是行的通的,在IE中却不行。因为使用IE内核的浏览器不 阅读全文

posted @ 2013-10-21 18:21 AngelLee2009 阅读(4192) 评论(0) 推荐(1)

禁用LinkButton的方法
摘要:1、服务器端,使用Enabled属性即可链接2、客户端,需要同时设置disabled和href属性//禁用function disableLink(link){ //删除href属性,使其成为文本元素 link.removeAttribute("href"); //设置disabled属性 link.setAttribute("disabled","disabled");}//启用function enableLink(link){ // 将id中的所有下划线(_)全部替换为美元 ($)符号; var postbackID = lin 阅读全文

posted @ 2013-10-21 17:52 AngelLee2009 阅读(2663) 评论(0) 推荐(0)

页面定时跳转
摘要:用Html标签实现页面定时跳转:<meta http-equiv="refresh" content="5;url=http://www.baid.com/"/> 阅读全文

posted @ 2011-10-08 11:49 AngelLee2009 阅读(166) 评论(0) 推荐(0)

实用的HTML标记及属性
摘要:1.<optgroup>选项组实例:<select><optgroup label="Swedish Cars"><option value="volvo">Volvo</option><option value="saab">saab</option></optgroup></select>必需属性:label标准属性:id,class,title,style,dir,l... 阅读全文

posted @ 2011-09-30 16:31 AngelLee2009 阅读(164) 评论(0) 推荐(0)

input不保留历史记录
摘要:可以用input自带的属性,来实现禁止input保留历史记录,代码如下:<input type="text" name="txtUserName" id="txtUserName" autocomplete="off"/> 阅读全文

posted @ 2011-09-30 11:21 AngelLee2009 阅读(767) 评论(0) 推荐(0)

导航