<script>
function IsEmpty(oText)
{
if(oText.id=="text1")
{
var oText = document.getElementById("text2");
if(oText.value)
{
alert("Another input is not empty")
}
}
if(oText.id=="text2")
{
var oText = document.getElementById("text1");
if(oText.value)
{
alert("Another input is not empty")
}
}
}
</script><input type="text" id="text1" onchange="IsEmpty(this)" />
<input type="text" id="text2" onchange="IsEmpty(this)" />
function IsEmpty(oText)
{
if(oText.id=="text1")
{
var oText = document.getElementById("text2");
if(oText.value)
{
alert("Another input is not empty")
}
}
if(oText.id=="text2")
{
var oText = document.getElementById("text1");
if(oText.value)
{
alert("Another input is not empty")
}
}
}
</script><input type="text" id="text1" onchange="IsEmpty(this)" />
<input type="text" id="text2" onchange="IsEmpty(this)" />
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货