Unexpected "Nodes" created when web page rendered

Hi All,

I have had an odd event which I cannot explain and which I have never come across before. So I thought that I would share this and see if anyone can come up with an answer to the problem so that it can be avoided in future or at least I can understand what happened.

I wrote a pretty ordinary horizontal menu in xhtml and styled it with css. Frequent checks on progress showed all was going well and as expected.

Then the text in the first button started not to align vertically correctly. This occurred in chrome, firefox and IE. Using chrome’s inspect element facility I found that an anchor tag was being inserted between the <li class=“buttonStd”> and the < a href=“xxxxxxx” etc etc. Looking around the inspector I found several instances where <a></a> was inserted where no such tag existed in the source code, in 2 instances comments were enclosed inside these mystery anchor tags.

I tried looking at the source code in TextPad, NotePad++, notepad and Komodo edit. I failed to find any reason for the existence of these anchor tags.

In the end I retyped the code via Komodo Edit it worked fine , then retyped the code via notepad++ it worked fine and finally retyped the code via TextPad and it worked fine. By the way I only recreated the html in each case. I wanted to retype with no cut and paste in each editor to try to eliminate any issues.

Has any one any ideas. I have surfed looking for an answer with no joy. Where did these mystery tags come from that could not be seen in any editor but could be seen by all the browsers. Now of course I can’t recreate the problem.

Everything is working fine now - I just need to understand where these tags came from for future reference.

All the best.

Check the output with a tool like wget or a debugging proxy like fiddler. My guess is either

  • html doesn’t validate, so browser fixes it
  • some browser plugin

Also have you tried with javascript off?

Hth, Jochen

Thanks Jochen. Yes I think were correct and the browser was adding the additional tags. Many thanks.