how to delete the last line...

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Mel

    #1

    how to delete the last line...

    i use the following to add a line. how can i delete the last line ?

    oDiv = document.getEle mentById("MyDiv ");
    oDiv.innerHTML = oDiv.innerHTML + string;


  • RobG

    #2
    Re: how to delete the last line...

    Mel wrote:[color=blue]
    > i use the following to add a line. how can i delete the last line ?
    >
    > oDiv = document.getEle mentById("MyDiv ");
    > oDiv.innerHTML = oDiv.innerHTML + string;
    >
    >[/color]

    The innerHTML method "specifies or receives the content between
    the start and end tags" of an element.

    <URL:http://msdn.microsoft. com/workshop/author/dhtml/reference/properties/innerhtml.asp>

    // content (text & all markup) replaced by ''
    // which effectively means deleted
    oDiv.innerHTML = '';

    // contents replaced by the value of 'string'
    oDiv.innerHTML = string;

    // contents replaced by text & markup
    oDiv.innerHTML = "Here is a <b>bold</b> word";



    --
    Rob

    Comment

    Working...