how to get <head> content of the current page with jquery or JS

faressoft picture faressoft · Aug 28, 2010 · Viewed 64.3k times · Source

how to get <head> content of the current page

Answer

user113716 picture user113716 · Aug 28, 2010

You could use the javascript DOM API like this:

var headContent = document.getElementsByTagName('head')[0].innerHTML;