Okay, this code doesn't work.

Code:
<html>

  <head>
    <script type="text/javascript">
      function SetText(myText) {
        var TargetEl = document.getElementById("TextBlock");
        TargetEl.replaceWholeText(myText);
      }

      var TestText = "Some test text.";
    </script>
  </head>

  <body>

    <p id="TextBlock">TSLIB</p>

    <p><a href="JavaScript:SetText(TestText);">Some test text.</a></p>

  </body>

</html>
First, don't complain about the use of the anchor tag. I'm not too keen on using it either, but it works.

Second, I'm sure there is a better way to do this, but I'm trying to understand this method. If you have a different way, I'm interested, but I want to make this way work, too.

Now, the replaceWholeText method is part of the Text object. At this point, TargetEl is an Element Object. So how does name space work? How can I grab this element/node in such a way that I can replace it's text?

Documentation helps, thanks.