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

JavaScript ?? ? ???? ???

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


?? ???

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

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

?? ?????? ?? ???? ???? ?? ??? ? ??? ?? ??? ?? ? ????. ??: if (age<18) document.write("Too young");
OperatorDescriptionExample
== isequal to x==8 is false
===??(? ? ??)x===5? true
>? x>8? false
<? ???? ????. x<8? ????
>=? x>=8? ?????
<=? x<=?? ??? ???? 8 is true

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


?? ???

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

given x = 6 ? y = 3, ?? ?? ?? ???? ?????. 1) is true||

or

(x==5 || y==5) is false

!not!(x==y) is true

?? ???

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

Syntax

variablename=(condition)?value1:value2

Example

?? age? ?? 18?? ?? ?? ??? "age too young"? ?????. ?? ??, ??? ??? "?? ??"? ?????.

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>php中文網(wǎng)(php.cn)</title>
</head>
<body>
<p>點(diǎn)擊按鈕檢測(cè)年齡。</p>
年齡:<input id="age" value="18" />
<p>是否達(dá)到投票年齡?</p>
<button onclick="myFunction()">點(diǎn)擊按鈕</button>
<p id="demo"></p>
<script>
    function myFunction()
    {
        var age,voteable;
        age=document.getElementById("age").value;
        voteable=(age<18)?"年齡太小":"年齡已達(dá)到";
        document.getElementById("demo").innerHTML=voteable;
    }
</script>
</body>
</html>

????? ???? ??? ???



???? ??
||
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>php中文網(wǎng)(php.cn)</title> </head> <body> <p>點(diǎn)擊按鈕檢測(cè)年齡。</p> 年齡:<input id="age" value="18" /> <p>是否達(dá)到投票年齡?</p> <button onclick="myFunction()">點(diǎn)擊按鈕</button> <p id="demo"></p> <script> function myFunction() { var age,voteable; age=document.getElementById("age").value; voteable=(age<18)?"年齡太小":"年齡已達(dá)到"; document.getElementById("demo").innerHTML=voteable; } </script> </body> </html>
            <var id="4ary5"><thead id="4ary5"></thead></var>