/    Sign up×
Community /Pin to ProfileBookmark

How to clear the contents in a frame?

1) Right now I have a <frame name=display>
2) Next I write something into the frame using top.display.document.write(“”);
3) SO, if I want to write something new into the same frame, how am I going
clear the previous content in the frame?

to post a comment
JavaScript

4 Comments(s)

Copy linkTweet thisAlerts:
@CharlesApr 07.2005 — top.display.document.write("");
Copy linkTweet thisAlerts:
@BigMoosieApr 07.2005 — document.open();
document.write("first time");
document.close;

document.open();
document.write("second time");
document.close;
Copy linkTweet thisAlerts:
@KorApr 07.2005 — You may also use [b]innerHTML[/b] instead of document.write()

top.frames['display'].document.getElementsByTagName('body')[0].innerHTML = '<b>new content bold</b>';
Copy linkTweet thisAlerts:
@Huang_YouyiauthorApr 08.2005 — Thanks Kor!! It works perfectly well..
×

Success!

Help @Huang_Youyi spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...