OT: need javascript/DOM help

Mike Wright mike.wright at mailinator.com
Fri Jun 20 21:09:45 UTC 2008


Hi Listizens,

I'm working on a project but am absolutely stymied and need outside 
help.  Both konqueror and firefox exhibit the same behavior so I don't 
think this is a browser bug.

I've checked the xhtml1-strict.dtd and it says that anchor tags support 
the core attributes which include "id"; however, the following html 
doesn't produce the expected results.

Are there any javascript/DOM gurus out there who can tell me why the 
html page below finds the <p> tag and the <div> tag but ignores the <a> tag.

Sorry for the OT/wrong forum post, but I find the collective knowledge 
of the fedora users to be one of the best out there... and the most helpful.

TIA,
Mike Wright :m)

Below is the html being tested.

=====================

<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE html
     PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head><title>Javascript DOM Experiments</title></head>
<body>

<p   id='m'></p>

<a   id='a'></a>
<p   id='p'></p>
<div id='v'></div>

<script type='text/javascript'><!--//
   var d = document;
   var m = d.getElementById('m');
   var a = d.getElementById('a');
   var p = d.getElementById('p');
   var v = d.getElementById('v');
   var b = '<br />';
   m.innerHTML = a+b+p+b+v+b;
//--></script>

</body>
</html>




More information about the fedora-list mailing list