⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ex5-8.htm

📁 《JAVASCRIPT 动态网页编程实例手册》一书中的源代码
💻 HTM
字号:
    <html>
    <head>
    <title>位运算符示例</title>
    </head>
    <body bgcolor="lightblue">
    <font size="+2" >
    <h3>位运算符演示 </h3>
    <script language="JavaScript">
           var result = 30 & 5;
           document.write("30 & 5  的结果为: " + result);
           result = 31 | 5;
           document.write("<br> 31 | 5  的结果为: " + result);
           result = 31 ^ 9;
           document.write("<br> 31 ^ 5  的结果为: " + result);
           result = 11 << 2;
           document.write("<br> 11 << 2 的结果为: " + result);
           result = 11 >> 2;
           document.write( "<br> 11 >> 2 的结果为: " + result);
           result = -11 >> 2;
           document.write( "<br> -11 >> 2 的结果为: " + result);
           result = 31 >>> 2;
           document.write( "<br> 31 >>> 2 的结果为: " + result);
           result = -31 >>> 2;
           document.write( "<br> -31 >>> 2 的结果为: " + result);
    </script>
    </body>
    </html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -