Share this page 

Print special character like copyright signTag(s): Language


  • Use the escape "&#" and the character number (in decimal) with ";".
  • Use the escape character "\" with the octal code. The following program prints all available characters with their decimal/octal codes
    <SCRIPT>
    document.write("There is no &#169; on this tip");
    document.write(" and no &#174; or &#153; too <br>");
    for (i=33; i<256; i++) {
      document.write
        ("&#"+i+"     dec =" + i +"   oct =" + (i).toString(8) );
      document.write("<br>");
      }
    </SCRIPT>
    
    output :
    
    

    To show in an alert box with accented characters, use something like this :
    alert("\350 \351 \352 \353 ");
    
    Try it