Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > how to delete the last line...

Reply
Thread Tools

how to delete the last line...

 
 
Mel
Guest
Posts: n/a
 
      03-23-2005
i use the following to add a line. how can i delete the last line ?

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


 
Reply With Quote
 
 
 
 
RobG
Guest
Posts: n/a
 
      03-24-2005
Mel wrote:
> i use the following to add a line. how can i delete the last line ?
>
> oDiv = document.getElementById("MyDiv");
> oDiv.innerHTML = oDiv.innerHTML + string;
>
>


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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
How to replace the last (and only last) character in a string? Johny Python 8 05-03-2007 09:24 PM
how to delete last node of a Linked list if you only know the address of last node. sangram C Programming 16 12-01-2006 08:57 PM
Passed 70-272 last Friday ... now a MCDST at long last! Devo-McDuff MCDST 7 04-20-2006 09:23 PM



Advertisments