<br><br><div class="gmail_quote">On Sat, Jun 21, 2008 at 12:09 AM, Mike Wright <<a href="mailto:mike.wright@mailinator.com">mike.wright@mailinator.com</a>> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi Listizens,<br>
<br>
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.<br>
<br>
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.<br>
<br>
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.<br>
<br>
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.<br>
<br>
TIA,<br>
Mike Wright :m)<br>
<br>
Below is the html being tested.<br>
<br>
=====================<br>
<br>
<?xml version='1.0' encoding='UTF-8'?><br>
<!DOCTYPE html<br>
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"<br>
    "<a href="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" target="_blank">http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd</a>"><br>
<html xmlns="<a href="http://www.w3.org/1999/xhtml" target="_blank">http://www.w3.org/1999/xhtml</a>" xml:lang="en" lang="en"><br>
<head><title>Javascript DOM Experiments</title></head><br>
<body><br>
<br>
<p   id='m'></p><br>
<br>
<a   id='a'></a><br>
<p   id='p'></p><br>
<div id='v'></div><br>
<br>
<script type='text/javascript'><!--//<br>
  var d = document;<br>
  var m = d.getElementById('m');<br>
  var a = d.getElementById('a');<br>
  var p = d.getElementById('p');<br>
  var v = d.getElementById('v');<br>
  var b = '<br />';<br>
  m.innerHTML = a+b+p+b+v+b;<br>
//--></script><br>
<br>
</body><br>
</html><br><font color="#888888">
<br></font></blockquote></div><br>will it's simple ,<br>what do you want to get from the getElementById('')?<br>I mean if you're trying to know what kind of element is it, just to process it in some how, then you will not get a result from just using the getElemntByid thing for example:<br>
<br>d.getElementById('p');<br>will return in Firefox: [object HTMLParagraphElement]<br>in IE Mac: [object P] <br><br>why don't you just specify what you want to get back from it let's say you may use:<br><br>
 var a = d.getElementById('a').innerText;<br>by the way adding href="" to the anchor tag will let  var a = d.getElementById('a'); return the href it self, if you still need an output that looks like:<br>
[object HTMLanchorElement]<br><br>tell me and will find a work around for you...<br>