Reply Via Newsgroup wrote:
Folks,
I have a cell in a table that has an IFRAME - The IFRAME is empty (ie it
has no source tag) but it does have a name (myFrame) and id (also called
myFrame).
I can write data to the frame, but cannot append to it - I know I could
put a textarea form box in there, however that is my least prefered
route in part because I have such little control over the display of the
contents that appears inside a <textarea> are box.
Thus... if I write data to using:
document.getEle mentById('myFra me').innerHTML= "<font size=+1
color=yellow>&p ound;"+tmp0+"</font>";
How can I append to the data already existing in the box - I gather I
would have to first read the contents, then append my new data, then
re-write to it but I'm not so sure on how I could do this...
All help, via the newsgroup would be much appreciated,
thanks in advance,
myVar = document.getEle mentById('myDiv ').innerHTML;
document.getEle mentById('myDiv ').innerHTML = myVar + newHTML;
or simply set it at one time:
document.getEle mentById('myDiv ').innerHTML =
document.getEle mentById('myDiv ').innerHTML + newHTML;
or simpler:
document.getEle mentById('myDiv ').innerHTML += newHTML;
Used with a div tag though. Not sure why you are using an IFrame tag
when it doesn't actually work that way. You have to document.write to an
IFrame, not change its innerHTML property.
--
Randy
Chance Favors The Prepared Mind
comp.lang.javas cript FAQ -
http://jibbering.com/faq/