Is it possible to modify inside the <head>
using JavaScript after the page is loaded? For example, if I add elements for external style sheets, will that be effective? Or if I change the <title>
, will that be reflected? If not, are there ways to do this?
Asked
Active
Viewed 130 times
-4

sawa
- 165,429
- 45
- 277
- 381
-
1Why didn't you try first? – zerkms Jan 08 '13 at 03:10
-
1@zerkms, well, for one thing, just because it works in the N browsers you might be able to try it on is no guarantee that it will work in browser N+1. On the other hand, if it were guaranteed behaviour in some spec, that would be a more concrete answer than "yup, it worked when I tried it in Chrome on Linux". – Paul Tomblin Jan 08 '13 at 03:15
-
1@Paul Tomblin: right, but from another point of view the question would sound in a different manner, like: I've found that I can do this and this, can anyone confirm it's cross-browser etc etc. – zerkms Jan 08 '13 at 03:23
1 Answers
6
Absolutely.
Although, changing the title is better done with document.title = "new title here";

Niet the Dark Absol
- 320,036
- 81
- 464
- 592
-
1+1, but you can also change title by innerhtml or text but document.title is preffered way :) – Zaffy Jan 08 '13 at 03:13