Forum Moderators: open

Message Too Old, No Replies

Access meta data through the DOM

         

chadmg

4:36 pm on Oct 26, 2004 (gmt 0)

10+ Year Member



Is there a way to access meta data through the DOM? Like document.meta['description'] or something?

whoisgregg

7:36 pm on Oct 27, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



This works as expected for me:

<script type="text/javascript">
<!--
function alertMeta(){
var a = document.getElementsByTagName("meta").item(0).content;
alert('The first meta tag on this page contains '+a+'.');
}
-->
</script>