當前位置:星座運勢大全官網 - 八字算命 - 算命bt

算命bt

Javascript代碼:函數f(o){ if(o . value % = 1){ alert(" Ji ");}else(alert(“兇”);}}正文中的代碼:

完整的代碼如下:

& lt!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN " " http://www . w3 . org/TR/XHTML 1/DTD/XHTML 1-Transitional . DTD " & gt;

& lthtml xmlns = " http://www . w3 . org/1999/XHTML " & gt;

& lthead & gt

& ltmeta http-equiv = " Content-Type " Content = " text/html;charset=gb2312" />

& lttitle & gt無標題文檔

& lt腳本語言= " javascript " & gt

函數f(){

var o = document . getelementbyid(" in ");

if(o.value%2==1){

Alert(“紀”);

}否則{

Alert(“兇”);

}

}

& lt/script & gt;

& lt/head & gt;

& ltbody & gt

& ltdiv id = " show " style = " margin-top:100 px;"align="center " >

& ltinput type = " text " name = " in " id = " in "/& gt;

& ltinput type = " button " name = " Bt " value = "開始算命" onclick = " f()"/& gt;

& lt/div & gt;

& lt/body & gt;

& lt/html & gt;