Creating <li> with JavaScript in an XUL Application

Posted by echox on Stack Overflow See other posts from Stack Overflow or by echox
Published on 2010-04-11T20:49:45Z Indexed on 2010/04/11 20:53 UTC
Read the original article Hit count: 465

Filed under:
|
|
|

Hi!

I try to create some li elements in my XUL Application. Theres only the text of the elements shown, but no list typical bullets and linebreaks.

Example:

  • text
  • text
  • text text text text text

Heres the JS Code I use to create the list:

var li = document.createElement('html:li');
var txt = document.createTextNode("only shown as simple text");
li.appendChild(txt);
document.getElementById('someList').appendChild(li);

HTML:

<html:ul id="someList">
    <html:li>this is shown in correct list style</html:li>
</html:ul>

I tried 'html:li' and also 'li' but nothing worked.

Any suggestions?

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about xul