当模糊事件触发时,我想让文本字段边框闪烁。我有像下面这样的动态文本字段。我尝试了下面的东西。 但这些代码不起作用。动态闪烁文本框边框
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Onload Highlight</title>
<script type="text/javascript">
function borderchange1(elem1) {
document.getElementById(elem1.id).style.border ="1px solid yellow";
setTimeout(borderchange2(elem1),500);
}
function borderchange2(elem2) {
document.getElementById(elem2.id).style.border ="1px dotted yellow";
setTimeout(borderchange1(elem2),500);
}
function run_it(element){
borderchange1(element);
borderchange2(element);
}
</script>
</head>
<body>
<input type="text" id="txt-0" onBlur="run_it(this)"><br>
<input type="text" id="txt-1" onBlur="run_it(this)"><br>
<input type="text" id="txt-2" onBlur="run_it(this)"><br>
<input type="text" id="txt-3" onBlur="run_it(this)">
</body>
</html>
如何让我的文本字段闪烁,当模糊事件触发?