Java Script: style for string

Thảo luận trong 'Thảo luận website, Forum' bắt đầu bởi integer, 3 Tháng một 2011.

  1. Offline

    integer

    • Tiếu Ngạo Giang Hồ

    • :-?
    Số bài viết:
    1.695
    Đã được thích:
    1.313
    Điểm thành tích:
    900
    Mã:
    <html>
    <body>
    
    <script type="text/javascript">
    
    var txt = "Hello World!";
    
    document.write("<p>Big: " + txt.big() + "</p>");
    document.write("<p>Small: " + txt.small() + "</p>");
    
    document.write("<p>Bold: " + txt.bold() + "</p>");
    document.write("<p>Italic: " + txt.italics() + "</p>");
    
    document.write("<p>Fixed: " + txt.fixed() + "</p>");
    document.write("<p>Strike: " + txt.strike() + "</p>");
    
    document.write("<p>Fontcolor: " + txt.fontcolor("green") + "</p>");
    document.write("<p>Fontsize: " + txt.fontsize(6) + "</p>");
    
    document.write("<p>Subscript: " + txt.sub() + "</p>");
    document.write("<p>Superscript: " + txt.sup() + "</p>");
    
    document.write("<p>Link: " + txt.link("http://www.w3schools.com") + "</p>");
    
    document.write("<p>Blink: " + txt.blink() + " (does not work in IE, Chrome, or Safari)</p>");
    
    </script>
    
    </body>
    </html>
    
    
    
    

    Đây là kết quả của code trên:

    Big: Hello World!
    Small: Hello World!
    Bold: Hello World!
    Italic: Hello World!
    Fixed: Hello World!
    Strike: Hello World!
    Fontcolor: Hello World!
    Fontsize: Hello World!
    Subscript: Hello World!
    Superscript: Hello World!
    Link: Hello World!
    Blink: Hello World! (does not work in IE, Chrome, or Safari)
    congthangitvn thích bài này.
  2. Offline

    lyvinhr00m

    • cụ lý

    Số bài viết:
    1.234
    Đã được thích:
    930
    Điểm thành tích:
    900
    Cái ji đây??? có học cái này đâu

Chia sẻ trang này

Advertising: Linux system admin | nukeviet | nukeviet 4 | Upload ảnh miễn phí