ele.style.backgroundColor = "";
解决方案 »
- //api.pinterest.com/v1/urls/count.json?callback=receiveCount&url=' + targetUrl +
- jquery中如何控制动画同时进行不同时结束?
- 控制代码运行问题
- 求助个问题
- 各位各位, Look Here! 请帮帮忙哦!!
- js函数能返回一个局部变量吗?会不会有内存泄漏问题?
- 如何在一个frame载入的页面中通过select控件的onchange事件来改变另外一个frame载入的页面
- 怎样判断以某个名称命名的窗口是否已经存在?
- “如果图片宽度大于75则重设为75”如何实现?已知的一种方法有问题
- 怎样让图片顺时针转90度
- 客户端动态生成的控件,怎样在服务器端获得值?
- 请教,比较两个字符串,返回不相同的字符
var ele = document.getElementById("name");
var oldValue=ele.style.backgroundColor;
ele.style.backgroundColor = "red";
.error {
...
}
</style>$("elementID").toggleClass("error")
var ele = document.getElementById("name");
var bgColor = '';
if(loadfirst)
{
if(ele.currentStyle)
{
bgColor = ele.currentStyle["backgroundColor"];
}
else
{
bgColor = document.defaultView.getComputedStyle(ele, null).getPropertyValue(backgroundColor);
}
}
if(ele.value is wrong) //用户输入错误
{
ele.style.backgroundColor = "red";
loadfirst = false;
}
else
{
ele.style.backgroundColor = bgColor;
}
var ele = document.getElementById("name");
var oldValue=ele.style.backgroundColor;
ele.style.backgroundColor = "red";同意三楼
ele.style.backgroundColor = "";