\b

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Miodrag Stancevic

    \b

    Please give me a proper use of switcher \b in command document.write.
    My goal is:
    1. write a number on a screen
    2. restore position of writing one character to the left (backspace)
    3. write some else number over first number with overwrite

    If I write:

    <body>
    <script language="JavaS cript">
    document.write( 1, "\b")
    document.write( 2)
    </script>
    </body>

    I get a rectangle (??) between 1 and 2 like a result in IE v6.0.










  • Lee

    #2
    Re: \b

    Miodrag Stancevic said:[color=blue]
    >
    >Please give me a proper use of switcher \b in command document.write.[/color]

    There is no proper use of \b in document.write.

    Whatever you write via document.write( ) is interpretted as HTML.
    HTML does not have a backspace character.

    You can change the contents of a container:

    <html>
    <head>
    <script type="text/javascript">
    function count(){
    var myDiv=document. getElementById( "alpha");
    myDiv.innerHTML =parseInt(myDiv .innerHTML,10)+ 1;
    setTimeout("cou nt()",1000);
    }
    </script>
    <body onload="count() ">
    <div id="alpha">
    0
    </div>
    </body>
    </html>

    Comment

    Working...