ex9-23.htm

来自「有关JAVASCRIPT的源代码教程」· HTM 代码 · 共 25 行

HTM
25
字号
    <html><head><title>String对象的方法-格式化字符串方法</title></head>
    <body bgColor="lightblue">
    <font face="宋体" size=+1>
    <h4>对象的方法-格式化字符串方法 </h4>
    <script language="JavaScript">
        <!--
        var str1 = "野旷天低树,江清月近人。";
        var str2 = new String("I did not object to the object.");
        document.write("<br>str1.anchor('chinapic')的运行结果为:"+ str1.anchor('chinapic'));
        document.write("<br>str1.big()的运行结果为:"+ str1.big());
        document.write("<br>str1.blink()的运行结果为:"+ str1.blink());
        document.write("<br>str1.bold()的运行结果为:"+ str1.bold());
        document.write("<br>str2的正常显示效果为:"+ str2);
        document.write("<br>str2.fixed()的运行结果为:"+ str2.fixed());
        document.write("<br>str1.fontcolor('blue')的运行结果为:"+ str1.fontcolor('blue'));
        document.write("<br>str1.fontsize('+2')的运行结果为:"+ str1.fontsize('+2'));
        document.write("<br>str1.italics()的运行结果为:"+ str1.italics());
        document.write("<br>str1.link('www.zcf.net')的运行结果为:"+ str1.link('www.zcf.net'));
        document.write("<br>str1.small()的运行结果为:"+ str1.small());
        document.write("<br>str1.strike()的运行结果为:"+ str1.strike());
        document.write("<br>str2.sub()的运行结果为:"+str1 +str2.sub());
        document.write("<br>str2.sup()的运行结果为:"+str1 +str2.sup());
        //-->
    </script>

⌨️ 快捷键说明

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