JScript输出方式

    xiaoxiao2023-03-24  3

    JScript  输出方式 dome 01 选择对话框 <title>无标题文档</title> <script type="text/javascript"> function choice(){ var mychoice=confirm("你是女士吗?"); if(mychoice==true){ document.write("你是女士!"); } else{ document.write("你是男士!"); } } </script> </head> <body> <input type="button" value="性别确认" οnclick="choice()" /> </body> </html> dome 02 读取对话框 <title>prompt</title>   <script type="text/javascript">   function rec(){ var score; //score变量,用来存储用户输入的成绩值。 score =prompt("请输入你的成绩","000-100")               ; if(score>=90) {   document.write("你很棒!"); } else if(score>=75)     {   document.write("不错吆!"); } else if(score>=60)     {   document.write("要加油!");     }     else {        document.write("要努力了!"); }   }   </script> </head> <body>     <input name="button" type="button" onClick="rec()" value="点击我,对成绩做评价!" /> </body> </html>
    转载请注明原文地址: https://ju.6miu.com/read-1202016.html
    最新回复(0)