HOW TO WRITE MESSAGES TO THE SCREEN WITHOUT USING "DOCUMENT.WRITE()"?

Amit Singh

Total Post:565

Points:2825
Posted by  Amit Singh
 1516  View(s)
Ratings:
Rate this:
  1. Amit Singh

    Post:565

    Points:2825
    How to write messages to the screen without using "document.write()"?

     When the method showStatus is invoked it will change the content of the span.
    Example:
    function showStatus(message) {
    var element = document.getElementById("mystatus");
    element.textContent = message; //for Firefox
    element.innerHTML = message; //for IE (why can't we all just get along?)
    return true;
    }
    <span id="mystatus">Test. </span>

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!