日期:2014-05-16 浏览次数:20591 次
<script type="text/javascript"> function compare(a,b) { if(a < b) { if (a < b) { alert('A is less than B'); } else if(a > b) { alert('A is greater than B'); } else { alert('A is equal to b'); } } } </script>
function compare(a,b) { if (a <= b) { alert('A is less than B'); } else if(a >= b) { alert('A is greater than B'); } else { alert('A is equal to b'); } }
<script type="text/javascript"> <![CDATA[ function compare(a,b) { if (a < b) { alert('A is less than B'); } else if(a > b) { alert('A is greater than B'); } else { alert('A is equal to b'); } } ]]> </script>
//<![CDATA[ function compare(a,b) { if (a < b) { alert('A is less than B'); } else if(a > b) { alert('A is greater than B'); } else { alert('A is equal to b'); } } //]]>