SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Threaded View

  1. #1
    SitePoint Zealot
    Join Date
    Oct 2005
    Posts
    155
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Using the DOM to write to page / label / div

    function ConjunctionJunction(){
    var strInputSize = document.getElementById("inputSize").value;
    strInputSize = strInputSize * 0.03937 + " inches";

    var writeIt = document.getElementById("WriteCalculation");
    writeIt.innerHTML = (strInputSize);

    }

    How do I write to a div or label or just plain text?

    The Div id="WriteCalculation area I have set asid for this function, only briefly displays the calculated result, but then it disappears.

    How do I get it to stay permanently?

    I am realizing after some preliminary research that innerHTML is not officially part of any W3C DOM specification, is that true?

    However, the case has been made that innerHTML is lightning fast compared to the DOM. http://www.quirksmode.org/dom/innerhtml.html
    Last edited by danjojo; Jun 4, 2007 at 06:14.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •