亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

JavaScript ?? ? ???? ???

JavaScript ?? ? ???? ???


?? ? ?? ???? ? ?? ??? ????? ? ?????.

?? ???

?? ???? ????? ??? ?? ??? ??? ???? ? ?????.

x=5? ?? ?? ???? ?? ???? ?? ?????.

QQ圖片20161025111207.png

?? ??

????? ?? ???? ???? ?? ??? ?? ??? ?? ??? ?? ? ????.

if (speed<180Km/h) document.write("?? ???");

? ????? ?? ???? ???? ?? ? ??? ?? ????.

?? ???

?? ???? ??? ? ??? ??? ???? ? ?????.

x=6 ? y=3? ? ?? ???? ?? ???? ?? ?????.


QQ圖片20161025111806.png

?? ???

JavaScript?? ?? ??? ?? ??? ?? ???? ?? ???? ???? ????.

Syntax

variablename=(condition)?value1:value2

Example

greeting=(visitor=="PRES")?"Dear President":"Dear";

?? Visitor? ?? "PRES"?? ?? Greeting? "Dear President" ?? ????, ??? ??? "Dear" ?? ?????.



???? ??
||
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> </head> <body> <p>點擊按鈕檢測年齡。</p> 年齡:<input id="age" value="18" /> <p>是否成年?</p> <button onclick="myFunction()">點擊按鈕</button> <p id="demo"></p> <script> function myFunction() { var age,voteable; age=document.getElementById("age").value; voteable=(age<18)?"未成年":"已成年"; document.getElementById("demo").innerHTML=voteable; } </script> </body> </html>