Here is a more W3C standards-compliant version, which should run in all DOM-capable browsers (Mozilla 1.x, Netscape 6.x and MS IE 5.x/6.x, Opera 7, maybe 6). This utilizes the usual view-serving-form (i.e., "$$ViewTemplateDefault") or page and the $$ViewBody field/embedded view.
Copy and paste the script below your view/view field and mark the entire script as pass-through HTML. I hope this works for all standards-compliant browsers and helps your daily business.
Do you have comments on this tip? Let us know.
This was first published in October 2003