Javascript Tools - Overview

DOM based, standards compliant scripts

This is a small collections of scripts that I've written to enhance webpages. They were written in about 2005 and follow best practice seperation between markup, design and behaviour. Since I wrote them things like mootools, jQuery etc... have all sprung up and offer these features in a nice package. However, these little scripts are still handy in occasions when you don't need a library to do something simple and maybe as a reference for people learning the basics of standards-compliant javascript.

So what's the big deal?

Using HTML & CSS together, allows you to separate out the design & structure of a document. Similarly, you can code Javascript so that it is all linked externally, easily allowing you to separate structure, and behaviour. This means that scripts are far more portable, and can easily be dropped in place with less messing. It also cleans up your HTML, making your documents, leaner, meaner & more accessible.


<script src="scriptname.js" type="text/javascript"></script>

That's it! Just include the line above, and these scripts will kick into action. The rest is all done via CSS. The scripts simply change classes/IDs, and allows you to style them, as you would normally.


Use as you wish, though it'd be nice if you can leave in the credit in the code.


Highlight Current Link

Searches through the document looking for links, and applies the class 'currentlink' to any links which link to the current document. This means you can easily highlight the current link without any server side coding. works great for navigation tabs.

Alternate Rows

Searches through the document for tables with the "alternateRows" class, and then sets the class of even rows to "even" for appropriate rows in that table, allowing for easy styling via CSS.


A simple popup script, which causes any link to have the class popup to open up in a new window. This means you don't have to add javascript to your code, and means the links continue to work, for search engines, and browsers without javascript.

Related Links

Related Articles

Related Scripts

« Back to