how to set window title in a webpage

107 views Asked by At

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.

1

There are 1 answers

0
Keith Enlow On BEST ANSWER

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;