zoukankan      html  css  js  c++  java
  • js的一些笔记

    var txt = "Hello World!";
    document.write("<p>字体变大: " + txt.big() + "</p>");
    document.write("<p>字体缩小: " + txt.small() + "</p>");
    document.write("<p>字体加粗: " + txt.bold() + "</p>");
    document.write("<p>斜体: " + txt.italics() + "</p>");
    document.write("<p>固定定位: " + txt.fixed() + "</p>");
    document.write("<p>加删除线: " + txt.strike() + "</p>");
    document.write("<p>字体颜色: " + txt.fontcolor("green") + "</p>");
    document.write("<p>字体大小: " + txt.fontsize(6) + "</p>");
    document.write("<p>下标: " + txt.sub() + "</p>");
    document.write("<p>上标: " + txt.sup() + "</p>");
    document.write("<p>链接: " + txt.link("http://www.w3cschool.cc") + "</p>");
    document.write("<p>闪动文本: " + txt.blink() + " (不能用于IE,Chrome,或者Safari)</p>");

    document.write(txt.length);

    document.write(str.match("world") + "<br>");
    document.write(str.match("World") + "<br>");
    document.write(str.match("worlld") + "<br>");
    document.write(str.match("world!"));

    var str=document.getElementById("demo").innerHTML;
    var n=str.replace("Microsoft","W3CSchool");
    document.getElementById("demo").innerHTML=n;

    <script>
    function startTime(){
    var today=new Date();
    var h=today.getHours();
    var m=today.getMinutes();
    var s=today.getSeconds();// 在小于10的数字钱前加一个‘0’
    m=checkTime(m);
    s=checkTime(s);
    document.getElementById('txt').innerHTML=h+":"+m+":"+s;
    t=setTimeout(function(){startTime()},500);
    }
    function checkTime(i){
    if (i<10){
    i="0" + i;
    }
    return i;
    }
    </script>
    </head>
    <body onload="startTime()">

  • 相关阅读:
    音视频-x624和H.264
    状态机解决复杂逻辑及使用
    任意程序上的蒙版画笔实现
    WPF-3D圆柱体透视
    WPF-3D-Z-buffering 导致的遮盖物体不渲染问题
    WPF3D立方体图形展开动画思路
    解决Prism 8.0 I添加InvokeCommandAction xaml报错问题
    Spark编程基础(Python版)
    前端开发工具fscapture
    修改element ui select选择器 样式
  • 原文地址:https://www.cnblogs.com/jiangyi666/p/6236951.html
Copyright © 2011-2022 走看看