jqueryview-source

Change meta Tag with Jquery - Cant see it in view sourcecode


I change the content of a metatag like this:

$('meta[name=myMeta]').attr('content', 'newContent');

this works and

console.log($('meta[name=myMeta]').attr('content'));

resonses me the 'newContent'

but if i now click "View Sourcode" i cant see the changes i made with jquery.

Can i solve this some how?


Solution

  • Viewing the source code in the browser shows the HTML as it was downloaded from the server.

    To see amendments you have made to the DOM after the page has loaded, you need to use a DOM inspector, usually available by pressing F12.