Today I got tired of seeing yet another onclick="obtrusivejavascript()" in HTML so I wrote a little program in protest. What I wanted to do though was to post the program to Twitter which has a 140 character limit so it was mildly challenging. Here it is:
Fully expanded:
var elems = document.getElementsByTagName("*");
for (var i = 0; elems[i]; i += 1) {
if (elems[i].getAttribute("onclick")) {
elems[i].onclick = function () {
alert("FAIL!");
}
}
}
Compressed for Twitter:
var x=document.getElementsByTagName("*");for (var i=0;x[i];i++){if (x[i].getAttribute("onclick")){x[i].onclick=function(){alert("FAIL!");}}}
I invite you to continue the trend. Write 140 character (or less) JavaScript programs and post them to Twitter then post a link here in the comments. If the trend grows, I’ll build a small site to host the activity.
I’ll go first!★

http://twitter.com/ara_p/statuses/861969980
Since I no longer use twitter, I’ve posted mine at identi.ca.
http://identi.ca/notice/110038
135 characters.
Here’s mine. Death to inline styles…
http://twitter.com/nathansmith/statuses/862131931
Here’s my contribution: a mild alteration for unaccessible images.
http://twitter.com/davelowe/statuses/862141134
I’ve got one – Don’t use font tags… they’re evil
http://twitter.com/starzonmyarmz/statuses/862153947
http://twitter.com/thatjsguy/statuses/862229507
Different for different pages….