MaheshG
MaheshG

Reputation: 41

how to set window title in a webpage

is there any possible way to set document window title.I've a webpage, in that webpage we are loading Iframe(which is from another project).By default it is taking current webpage title.how can I override the title with with current Iframe page title.

Upvotes: 0

Views: 105

Answers (1)

Keith Enlow
Keith Enlow

Reputation: 914

I think this is what you are looking for. Get the title for the iframe in whatever manner works best for you and then set the document title using:

document.title = "New Title"

If you don't know how to get the iframe title, try something along these lines:

document.title = document.getElementById("main-content-iframe").contentDocument.title;

Upvotes: 1

Related Questions