views:

77

answers:

2

how to get <head> content of the current page

+4  A: 

You can use an element selector to get <head>, for example:

$("head")
//for example:
alert($("head").html()); //alerts the <head> children

You can give it a try here

Nick Craver
This site http://jsfiddle.net is awesome.
faressoft
+3  A: 

You could use the javascript DOM API like this:

var headContent = document.getElementsByTagName('head')[0].innerHTML;
patrick dw
This code helps me in my project. Thanks
faressoft