Are you test-infected? Learned already how to grow your server-side apps using unit testing and want to do the same with client (HTML) layer? Search no more! QUnit to the rescue!
<link rel="stylesheet" href="/resources/qunit.css">
Then you can start writing your tests, the simplest one, taken from documentation: