<html>
<head>
<script type="text/javascript">
var flag1=true;
var flag2=true;
var flag3=true;
function f1(){
var text1=document.getElementById("t1");
if(flag1==true){
text1.value="";
flag1=false;
}
}
function f2(){
var text2=document.getElementById("t2");
if(flag2==true){
text2.value="";
flag2=false;
}
}
function f3(){
var text3=document.getElementById("t3");
if(flag3==true){
text3.value="";
flag3=false;
}
}
</script>
</head>
<body>
<input type="text" id="t1" value="condition1" οnfοcus="f1()">
<input type="text" id="t2" value='condition2' οnfοcus="f2()">
<input type="text" id="t3" value='condition3' οnfοcus="f3()">
<input type="submit" value="提交"><br>
</body>
</html>
<head>
<script type="text/javascript">
var flag1=true;
var flag2=true;
var flag3=true;
function f1(){
var text1=document.getElementById("t1");
if(flag1==true){
text1.value="";
flag1=false;
}
}
function f2(){
var text2=document.getElementById("t2");
if(flag2==true){
text2.value="";
flag2=false;
}
}
function f3(){
var text3=document.getElementById("t3");
if(flag3==true){
text3.value="";
flag3=false;
}
}
</script>
</head>
<body>
<input type="text" id="t1" value="condition1" οnfοcus="f1()">
<input type="text" id="t2" value='condition2' οnfοcus="f2()">
<input type="text" id="t3" value='condition3' οnfοcus="f3()">
<input type="submit" value="提交"><br>
</body>
</html>