- From: Simon Pieters <zcorpan@hotmail.com>
- Date: Fri, 02 Sep 2005 17:38:52 +0000
Hi, >Since that's not actually a link (the href points to the javascript: URL >scheme which is an ugly hack), what's wrong with: > ><span id="print" class="link"></span> How is an empty span less harmful than an empty a element without an href attribute? >Where the link class may be styled to look like a link with CSS, and then > >var elm = document.getElementById("print"); >elm.onclick = window.print; >elm.appendChild(document.createTextNode("Print this page")); For keyboard access, you need a tabindex="0" which has no effect in legacy UAs, and you currently can't trigger the click event from keyboard in IE6 or Firefox on a span element. The javascript: URI scheme is a separate issue. If we replace the href with "http://example.org/" -- or "mailto:me at example.org", or "data:,foo", or whatever -- in my first example, I would still like to use an empty a element in the markup. Regards, Simon Pieters
Received on Friday, 2 September 2005 10:38:52 UTC