KHTML: handling of invalid <a> tags

kae verens kae at verens.com
Mon May 23 10:39:27 BST 2005


Dawit Alemayehu wrote:

>I cannot click on links @ my Citibank online account. It seems that KHTML can 
>properly handle the following invalid HTML:
>
><a href="javascript:alert('Hello World!')">
><big>Click Here</big>
>
>but not this one
>
><a href="javascript:alert('Hello World!')"/>
><big>Click Here</big>
>
>Notice the no close tag, i.e. </a>. Does dealing with the last case require 
>special work ? FWIW it works fine in Mozilla/Firefox...
>  
>

It's strange that it would work in Mozilla/Firefox, as the HTML of the
second one is actually correct, but does not apply the href to the <big>
element.

<a href="javascript:alert('Hello World!')"/><big>Click Here</big>
is equivalent to
<a href="javascript:alert('Hello World!')"></a><big>Click Here</big>

(see the W3C XHTML specs to undestand usage of '/' for closing elements)

In this case, it is actually Mozilla which should have a bug filed with
it. No browser should apply a link in this case to the <big> element.

Kae





More information about the kfm-devel mailing list