當模糊事件觸發時,我想讓文本字段邊框閃爍。我有像下面這樣的動態文本字段。我嘗試了下面的東西。 但這些代碼不起作用。動態閃爍文本框邊框
<!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>
如何讓我的文本字段閃爍,當模糊事件觸發?