用js给html表单设置style
2012-07-02 00:30
309 查看
原贴地址:http://heichong.iteye.com/blog/860698
关键字: 用js给html表单设置style 首先,把CSS和JS标签style属性对照表了解了: CSS 和 JavaScript 标签 style 属性对照表: 盒子标签和属性对照 CSS语法(不区分大小写) JavaScript语法(区分大小写) border border border-bottom borderBottom border-bottom-color borderBottomColor border-bottom-style borderBottomStyle border-bottom-width borderBottomWidth border-color borderColor border-left borderLeft border-left-color borderLeftColor border-left-style borderLeftStyle border-left-width borderLeftWidth border-right borderRight border-right-color borderRightColor border-right-style borderRightStyle border-right-width borderRightWidth border-style borderStyle border-top borderTop border-top-color borderTopColor border-top-style borderTopStyle border-top-width borderTopWidth border-width borderWidth clear clear float floatStyle margin margin margin-bottom marginBottom margin-left marginLeft margin-right marginRight margin-top marginTop padding padding padding-bottom paddingBottom padding-left paddingLeft padding-right paddingRight padding-top paddingTop 颜色和背景标签和属性对照 CSS 语法(不区分大小写) JavaScript 语法(区分大小写) background background background-attachment backgroundAttachment background-color backgroundColor background-image backgroundImage background-position backgroundPosition background-repeat backgroundRepeat color color 样式标签和属性对照 CSS语法(不区分大小写) JavaScript 语法(区分大小写) display display list-style-type listStyleType list-style-image listStyleImage list-style-position listStylePosition list-style listStyle white-space whiteSpace 文字样式标签和属性对照 CSS 语法(不区分大小写) JavaScript 语法(区分大小写) font font font-family fontFamily font-size fontSize font-style fontStyle font-variant fontVariant font-weight fontWeight 文本标签和属性对照 CSS 语法(不区分大小写) JavaScript 语法(区分大小写) letter-spacing letterSpacing line-break lineBreak line-height lineHeight text-align textAlign text-decoration textDecoration text-indent textIndent text-justify textJustify text-transform textTransform vertical-align verticalAlign <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML> <HEAD> <TITLE> New Document </TITLE> </HEAD> <script language="javascript"> function validate(){ if (document.all("name").value == ""){ document.all("name").style["borderColor"]="red";//就是这里 return; } } </script> <BODY> <input type="text" name="name" > </BODY> </HTML>
相关文章推荐
- 如何用js给html表单设置style
- 如何用js给html表单设置style
- 如何用js给html表单设置style
- js checkbox全选 反选 取消全部设置表单html复选框勾选
- 用js给html设置style
- eclipse安装Aptana 插件,并设置使之能提示css,js,html,帮助编写代码
- jquery验证表单的js代码(HTML+CSS+PHP代码部分省略)
- Html JS实现表单验证
- form表单action提交的js部分与html部分
- js获取fckeditor表单内容和相关fckeditor设置
- js checkbox全选 反选 取消全部设置表单checkbox复选框勾选
- html中的button按钮调用js函数和提交表单传递参数
- html中style的两种方式和js的两种方式
- JS表单设置值
- Jquery如何序列化form表单数据为JSON对象 C# ADO.NET中设置Like模糊查询的参数 从客户端出现小于等于公式符号引发检测到有潜在危险的Request.Form 值 jquery调用iframe里面的方法 Js根据Ip地址自动判断是哪个城市 【我们一起写框架】MVVM的WPF框架(三)—数据控件 设计模式之简单工厂模式(C#语言描述)
- js 设置style属性
- js对表单设置了readonly和disabled后的区别
- js设置html标签的onclick函数
- Felix's Node.js Style Guide——from http://nodeguide.com/index.html
- html的css文件中如果对id设置了display="none",那么在js中是无法控制display=""