操作css样式
<script type="text/javascript"> //产生一个四位的验证码。
function createCode(){
var datas = ['A','B','何','敏','凡','江','1','9']; // 0-7 长度8
var code = "";
for(var i = 0 ; i<4; i++){
//随机产生四个索引值
var index = Math.floor(Math.random()*datas.length); // random 0.0-1.0(不包括1.0)
code+=datas[index];
} var spanNode = document.getElementById("code");
spanNode.innerHTML = code;
spanNode.style.fontSize ="24px";
spanNode.style.color = "red";
spanNode.style.backgroundColor="gray";
spanNode.style.textDecoration = "line-through";
} function ready(){
createCode();
} </script>
<body onload="ready()">
<span id="code"></span><a href="#" onclick="createCode()">看不清,换一个</a> </body>
操作css样式的更多相关文章
- JQuery中操作Css样式的方法
JQuery中操作Css样式的方法//1.获取和设置样式 $("#tow").attr("class")获取ID为tow的class属性 $("#tw ...
- jQuery操作css样式
jQuery操作css样式 css操作的分类: css操作 位置操作 尺寸操作 css操作之css css代码: html代码: jQuery代码: 效果如下: css操作之位置操作 css代码: h ...
- jq选择器(jq 与 js 互相转换),jq操作css样式 / 文本内容, jq操作类名,jq操作全局属性,jq获取盒子信息,jq获取位置信息
jq选择器(jq 与 js 互相转换) // 获取所有的页面元素jq对象 $('css3选择器语法'); var $box = $(".box:nth-child(1)"); 获取 ...
- 11-13 js操作css样式
1.Js操作css样式 Div.style.width=”100px”.在div标签内我们添加了一个style属性,并设定了width值.这种写法会给标签带来大量的style属性,跟实际项目是不符. ...
- 【转发】JQuery中操作Css样式的方法
JQuery中操作Css样式的方法 //1.获取和设置样式 $("#tow").attr("class")获取ID为tow的class属性 $("#t ...
- js操作css样式、js的兼容问题
一.js操作css样式 div . style . width="200px" 在div标签内我们添加了一个style属性,并设定width值.这种写法会给标签带来大量的style ...
- jquery操作css样式的方法
jquery操作css样式的方法(设置和获取)
- jquery轻松操作CSS样式
$(this).click(function(){ if($(this).hasClass(“zxx_fri_on”)){ $(this).removeClass(“zxx_fri_on”); ...
- js操作css样式,null和undefined的区别?
1.js操作css的样式 div.style.width="100px"在div标签内我们添加了一个style属性,并设定了width值.这种写法会给标签带来大量的style属性, ...
- jquery操作CSS样式全记录
$(this).click(function(){ if($(this).hasClass(“zxx_fri_on”)){ $(this).removeClass(“zxx_fri_on”); ...
随机推荐
- 【转】Eclipse导入library的时候报:Found 2 versions of android-support-v4.jar in the dependency list
原文网址:http://www.07net01.com/2015/03/779691.html 错误类型:Eclipse导入library的时候报:Found 2 versions of androi ...
- (转载)apc_fetch
(转载)http://php.net/manual/zh/function.apc-fetch.php apc_fetch (PECL apc >= 3.0.0) apc_fetch — 从缓存 ...
- R学习日记——分解时间序列(季节性数据)
上篇说明了分解非季节性数据的方法.就是通过TTS包的SMA()函数进行简单移动平均平滑.让看似没有规律或没有趋势的曲线变的有规律或趋势.然后再进行时间序列曲线的回归预测. 本次,开始分解季节性时间序列 ...
- Robot Framework web测试demo
1.Open RIDE: ride.py 2.New Project: "File" -> "New Project" ,click "OK&q ...
- Hu矩SVM训练及检测-----OpenCV
关键词:Hu矩,SVM,OpenCV 在图像中进行目标物识别,涉及到特定区域内是否存在目标物,SVM可在样本量较少情况下对正负样本(图片中前景背景)做出良好区分,图片基本特征包括诸如HOG.LBP.H ...
- [Javascript] What is JavaScript Function Currying?
Currying is a core concept of functional programming and a useful tool for any developer's toolbelt. ...
- [转] 深入剖析 linux GCC 4.4 的 STL string
本文通过研究STL源码来剖析C++中标准模板块库std::string运行机理,重点研究了其中的引用计数和Copy-On-Write技术. 平台:x86_64-redhat-linux gcc ver ...
- vipw和vigr命令
Modifying the Configuration Files To add user accounts, it suffices that one line is added to /etc/p ...
- linux定时任务1-crontab命令
简单测试例子: 添加定时任务前,注意查看crond服务是否已经启动,如果未启动,则用命令service crond start命令启动. 注意给脚本添加可执行权限. [root@rheltest1 ~ ...
- 如何缩减Try{}Catch{}Finally{}代码----定义一个公用的Try{}Catch{}Finally{}
public class Process { public Process() { } public static void Execute(Action action) { try { //ACTI ...