# as3 HTML text issue - bewildering

**URL:** <https://forum.kirupa.com/t/as3-html-text-issue-bewildering/281969>\
**Category:** flash\
**Created:** [February 16, 2009, 9:31am UTC](https://forum.kirupa.com/t/as3-html-text-issue-bewildering/281969 "2009-02-16T09:31:24Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![partimer](https://avatars.discourse-cdn.com/v4/letter/p/f1d935/32.png) [@partimer](https://forum.kirupa.com/u/partimer)\
**Post date:** [February 16, 2009, 9:31am UTC](https://forum.kirupa.com/t/as3-html-text-issue-bewildering/281969/1 "2009-02-16T09:31:24Z")

</div>

Hi all,

I’ve got this tiny bit of code that adds html text to a text box on the click of a button. Another button clears the textField and another adds different html text. Trouble is that the first text includes list ‘li’ items - the second doesn’t. But the second still appears as list items - so it seems the formatting hasn’t been cleared?

I’ve not closed the li tags but surely this shouldn’t make a difference when the textField is cleared then repopulated?

I’ve tried adding stylesheets - then clearing the stylesheet when clearing the text - same thing?

Anybody else run into this at all?

Many thanks in advance.

```auto
    but1.addEventListener(MouseEvent.CLICK,addText1);    
    
    but2.addEventListener(MouseEvent.CLICK,clearText);    
    
    but3.addEventListener(MouseEvent.CLICK,addText2);
    
     function addText1(e:Event):void {
        thisText.htmlText = '<LI><FONT FACE="Arial" SIZE="14" COLOR="#000000" LETTERSPACING="0" KERNING="0">List item text<FONT FACE="GG Superscript">5,9</FONT>';
     }
     function clearText(e:Event):void {
        thisText.htmlText = '';
     }     
     function addText2(e:Event):void {
        thisText.htmlText = '<P ALIGN="LEFT"><FONT FACE="Arial" SIZE="21" COLOR="#000000"><B>Shouldnt be a list item at all</B></FONT></P><P ALIGN="CENTER"><FONT FACE="Arial" SIZE="21" COLOR="#000000"><B>Whats going on?</B></FONT></P>';
        trace(thisText.htmlText);     
     }

```
