function String(object){ //当输入的汇率货单位不是数字的时候,提示输入错误,让其从新输入
var value =object.value;
var oinput = object.id;
var parent=/^[A-Za-z]+$/;
var c = value.toUpperCase();
if(value!=""){
if(parent.test(value)) {
if(value!=c||c.length!=3){
document.getElementById(oinput).style.backgroundColor="#FF0000";
alert("只能输入3位英文大字母!");
document.getElementById(oinput).value="";
return;
}else{
document.getElementById(oinput).style.backgroundColor="#FFFFFF";
return;
}
}else{
document.getElementById(oinput).style.backgroundColor="#FF0000";
alert("只能输入3位英文大字母!");
document.getElementById(oinput).value="";
//document.getElementById(oinput).focus();
return;
}
}else{
document.getElementById(oinput).style.backgroundColor="#FFFFFF";
return;
}
}
你好:这个的话;直接onclick事件就可以了,上面的是设置input的,你可以改成设置background的
追问你好,可能是我没描述清楚,我是通过UIManager.setLookAndFeel(String className)设置窗口皮肤的,现在我希望可以通过点击界面中的按钮来改变classname,从而改变窗口皮肤,不知道这样做可不可行、 怎么用代码实现。谢谢