What is the best way to show changeble text?

I need to show text that can be changed in script.

What's the best way I mean, what's the best element to use in markup that allow you to change the text via script

And document.element.state.value = "sometext"; is correct

edit: I got it using <input> with the mode="display", now my question is how to make the input "unfocusable", i mean avoiding the input to get the focus when i move throw the bottons on the screen.

edit2: style:navIndex="none" on the input was the solution

 




Answer this question

What is the best way to show changeble text?

  • Gordon Hempton

    mmm this don't work for me...

    in markup I have

    <p id="par" style="TextStyle01"></p>

    and in script I have

    document.foo.firstChild.data = "Here is the new text";

    Did i use something wrong

    edit: it worked when i put some initial text in the p

    btw, I don't understand how the firstchild.data works, there's any document or explanation that i could read



  • Matt Penfold

    The W3C DOM spec -- http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html

    If you don't have any initial data, you would insert a child TEXT node.



  • MatteusX

    something like this, right

    var newtext = document.createTextNode("sometext");

    document.par.appendChild(newtext);



  • Kamii47

    I believe HDiSim has a bug where it still includes navIndex="none" elements in the implicit nav list. They never get the focus, but they use up a spot in the list. So you end up having to cursor over the phantom elements.

    You can also use a span or a p and use the W3C DOM APIs to change the text of them. For example, given a p named foo, you can do:

    document.foo.firstChild.data = "Here is the new text";



  • What is the best way to show changeble text?