<div id="div1">
<div "div2">
</div>
</div>
javascript:
var div1 = document.getElementById('div1').height
var div2 = document.getElementById('div2').height
if(div1-div2<0)
alert("1")
function getTotal(){var txt1= document.getElementById("txt1").value
var txt2= document.getElementById("txt2").value
var txt3= document.getElementById("txt3").value
var txt4= document.getElementById("txt4").value
var txtTotal=txt1+txt2+txt3+txt4
if(txtTotal>100){
//写你自己的操作
}
}