| Is it possible to edit the META tag using Java Script? |
Started by a.smith
10 Apr 2012 09:28
SUBSCRIBE
UNSUBSCRIBE
|
|
|
|
So say you have... <meta name="viewport" content="width=240">
is it possible to edit that with Java Script by doing something like
document.meta.content="width=382"; (example XD)
in a Java Script function? i have no idea if theres any way i could try it or test it without a divice other than my phone :/
|
Ok now i dont need to know because i fould out about the divice-width thing xD nooish me xD though it still would be interesting to know :o
|
Hm, never thought about that. :/
Buoyancy: what goes down, must come up..
|
Will i don't think so you might need to do more research to find you answer
Founder and CEO of DsiRealms
|
<meta id="meta" name="viewport" content="width=device-width"/>
In Java Script,
You could do:
document.getElementById("meta").content="width=240";
Or you could do:
document.getElementById("meta").attributes['content'].value="width=240";
Or you could do:
document.getElementById("meta").attributes[1].value="width=240";
Or you could do:
document.getElementsByTagName("meta")[INDEX].content="width=240";
Or you could do:
document.getElementsByTagName("meta")[INDEX].attributes["content"].value="width=240";
Or you could do:
document.getElementsByTagName("meta")[INDEX].attributes[1].value="width=240";
Does that answer your question? ;)
Success today, greatness tomorrow.
|
Coolio :o Yesh it does :] though i'll probarbly never use it xD depends lol
|
Nice i heard of that before
Founder and CEO of DsiRealms
|
|
|
|