Jump to Real's How-to Main page

Read a META variable

<META NAME="Real's HowTo" CONTENT="http://www.rgagnon.com/">
<TITLE>Real's Javascript How-to</TITLE>
<SCRIPT>
function checkMeta() {
  var metas = document.getElementsByTagName('META');
  var i;
  for (i = 0; i < metas.length; i++)
    if (metas[i].getAttribute('NAME') == "Real's HowTo")
      break;
  var TestVar = metas[i].getAttribute('CONTENT');
  alert(TestVar);
}
checkMeta();
</SCRIPT>

If you find this article useful, consider making a small donation
to show your supportfor this Web site and its content.

Written and compiled by Réal Gagnon ©1998-2005
[ home ]