\b

  • Thread starter Miodrag Stancevic
  • Start date
M

Miodrag Stancevic

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="JavaScript">
document.write(1, "\b")
document.write(2)
</script>
</body>

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

Lee

Miodrag Stancevic said:
Please give me a proper use of switcher \b in command document.write.

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("count()",1000);
}
</script>
<body onload="count()">
<div id="alpha">
0
</div>
</body>
</html>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top