DISCLAIMER:I didn’t even bother testing this blog posting in IE, though in practice I have made it work in all browsers. If you are using IE, you can go here to fix the problem.

According to the HTML spec, nested links are illegal. Good, fine, OK. Personally I am having a hard time understanding why anyone would want to nest links. I mean, why would anyone want to do this:
Blizzo loves
Ajaxian
The problem is, however, that I can see a need for nested onClick events. Consider the following happy little onclickable characters, the box and the link. Go ahead, click them, you know you want to…

The Box The Link
Oh So Clickable

As my old drafting teacher used to say, “Peace, Love, Happiness Be”. This is all just great. The problem comes when the the sexual tension that has been building between these two for the last three seasons finally reaches critical mass and they become one. We don’t just get a dip in the ratings, we have a problem:

What if when you click the link, I don’t want the div to change color, because in his contract he states he refuses to do color changes with anyone else on the set at the same time. Prima donna <div>’s. A little JavaScript can solve this problem, like so:

The freeze_js variable prevents the onClick action of the <div> when the link is clicked, but it still changes color when you click on the div outside the link. You, in the back row, come up here and try it out for the class.

So now that we have everyone playing nicely together, we may even get contracts for another 13 episodes. My question becomes… is this icky? Would you expect everything to fire off when you click, or just the one thing you click on? As web UI’s become more complex, how should we handle this problem? Huh, huh, huh?