JS

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script>
        var x=3;
        x=2;
        if(2>1){
            alert(2323);
        }
        else{
            alert(5555)
        }
     function f() {
           document.write(parseInt(3.1415926))//页面输出
        }
        console.log(f())
        console.log(typeof f())//展示数据类型.
        console.log( parseInt(3.1415926))
        parseInt(3.1415926)//强行转换
       var x=[1,2,3,4];
        for (i=0;i<4;i++)
        {
            console.log(x[i])
        }

        var dic={"key":"value"};
        console.log(dic[0])
        console.log(dic.value)
       // console.log(x[0])
        var N= NaN;//和谁比较都是false
         console.log(NaN>5)
         console.log(NaN<5)
         console.log(NaN==5)
         console.log(NaN!=5)
         console.log(NaN==NaN)
         console.log(2&1)//0
         console.log(2|1)//3
         console.log(2==2)//True
         console.log(2=="2")//True
         console.log(3>20)//false
         console.log(3>"20")//False
         console.log("3">"20")//这个是按照ASCLL标定的,这个是True
        var data= new Date();
         document.write(data.toDateString())//显示时间英文的
         document.write(data.toTimeString())//显示时间中文的
         document.write(data.getDate())
         document.write(data.getHours())
        function f1(obj) {
            alert("你输入的值是:" +obj.value);
        }
        function f2() {
            alert("欢迎来到这个世界")
        }
        var arry=["hellow",[1,2],{"key":"value"}];
         for(var i in arry)
         {
             console.log(arry[i]);
         }
         console.log(typeof arry[2]);
         console.log(arry[2].constructor);
         var S_sort=[5,8,1,2,9,10,120,139,1000];
         function li_sort(a,b)
         {
             return a-b;
         }
         console.log(S_sort.sort(li_sort));//如果是按照之前的,不加入自定义排序规则那么就只是按照第一个数字的大小进行排序。结果就是
                                           // 1,120,139,等等~
        var Stack=[1,3,5,8,9];
        Stack.push("heoolw")//在后面插入数值
        console.log(Stack)
        Stack.unshift("word")//在前面插入元素。
        console.log(Stack)
        Stack.pop()
        Stack.pop()
        var pop_data=Stack.pop()
        console.log(Stack)
        console.log(pop_data)
        var ret=window.confirm("hello,word!")//点击确定是True,取消是False.
        console.log(ret)
       var res2=window.prompt("")//这个弹出框,用于接收文本的,并且可以打印在浏览器中。
        function f() {
             var current_Time=new Date().toLocaleString();
             var ele=document.getElementById("time")
             ele.value=current_Time;
        }
        function f1() {
              f();
              setInterval(f,1000);//
        }
     function f1(){   location.reload("https://www.baidu.com");}
       var res=  window.prompt("12345")
       console.log(res)
        window.confirm("56789")

    </script>
</head>
<body>
<div class="div1">
    <p class="p1">hellow,word!</p>
</div>
<input type="text"  class="Input_content">
<input type="button" name="name" value="value">


</body>
</html>

 

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值