中文(繁体)
<html> <head> <script language="JavaScript"> //用JS計算您的胸罩尺寸建站學院http://www.downcodes.com function jisuan() { if (document.form1.up.value== '') { alert ('請填入上胸圍的尺寸:'); return false; } if (document.form1.up.value=='') { alert ('請填入下胸圍的尺寸:') ; return false; } var answer=document.form1.up.value-document.form1.under.value; yushu=document.form1.under.value%10; if (yushu < 5) yushu = 0; if (yushu > = 5) yushu = 5; chima='您的胸罩尺寸為:'+(Math.floor(document.form1.under.value/10)*10+yushu/1); if (answer <= 10) chima= chima+'A'; else if (answer <=14 && answer >=11) chima=chima+'B'; else if (answer <=19 && answer >=14) chima=chima+'C'; else chima=chima+' D'; alert (chima); } </script> </head> <body> <form name="form1" method="post"> 請填入上胸圍尺寸: <input name="up" type=" text" size="8"> CM <br>請填入下胸圍尺寸: <input name="under" type="text" size="8"> CM <br> <input type="submit" name= "Submit" value="計算" onclick="jisuan();"> <input type="reset" name="Submit2" value="重填"> </form> </body> </html>