jaymc Posted October 29, 2007 Share Posted October 29, 2007 What is the best way to add a line of data at the bottom of a div <div> line 1 line 2 line 3 line 4 line 5 line 6 line 7 line 8 </div> How can I add 'line 9' after line 8 I want to avoid using (GET THE INNER HTML, ADD 'LINE 9' to it, THEN ADD ALL THE CONTENT BACK IN THE DIV) The reason being, there may be up to 1000 lines of data in a div and I will be adding new lines every 20 seconds so may not be very practical Whats the best way? Quote Link to comment Share on other sites More sharing options...
fenway Posted October 30, 2007 Share Posted October 30, 2007 Use the DOM function and create a new element at the "end" of the current element. Quote Link to comment Share on other sites More sharing options...
jaymc Posted October 30, 2007 Author Share Posted October 30, 2007 Can anyone provide an example? Edited: Ahh ok I've found it http://www.javascriptkit.com/javatutors/dom2.shtml Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.