I need to change the value of the “content” prop in meta tag… it looks like this is not easy… I looked it up… found a no. of SO threads about this… some respondents seemed horrified – ‘why on earth do you need to change the value of the ‘content’ prop in meta tag???’ well, I need to change it b/c in my website the language changes dynamically, from English to Spanish and vice-versa…
when I switch languages I can see clearly in Firebug how the content of the <title> element changes and also the value for the property “lang” in <html> tag (& other elements…) but the ‘content’ prop in <meta...> elem doesn’t budge (which I set up for it to change, just like for the other elements…)
(var metaKeywords of course evaluates to something diff, depending on what language is loaded…)
I even gave the meta tag an id, in the hopes of making it work this way, but it also doesn’t work…
is there any way at all to accomplish this? you can change practically every tag, properties, of tags, etc… dynamically, why not the value for the ‘content’ prop in meta tag? I find this weird…
Since they are there for the benefit of the browser (and spiders) not the user and are not actual page content, I don’t see this working or having the effect you imagine.
Probably something that would be best handled at the back-end.
<meta id="metakeywords" name="description" content="A general guide on the use of meta tags in html pages">
var metakeywords = "hello hello hello";