Far Too Easy JavaScript

Funny how sometimes you think things will be harder than they are. I just finished off the form box clearing JavaScript for Planet Bods, so that as well as working with input text boxes (single line text boxes), it also works with textareas (multiple line text boxes).

I was all geared up to do incredibly complex stuff with the DOM and I didn't have to, cos everything was extremely straightforward. Humpf. I feel cheated now. JavaScript should be ridiculously complex, else what's the point of it!

Anyway, the revised script is rather simple. In a HTML form, it clears a text box of it's dummy text when you focus on it it. If you type something in, and then move to another box, it keeps that content.

If you don't type anything in, it restores the dummy text. Exciting eh? Best place to see it in action is the Planet Bods Email Page if you care enough. It amuses me anyway.

Have your say

If you'd like to customise the picture shown next to your comment on this, and many other websites, you can do so by using Gravatar.

Please note that your email address will not be displayed on this website. All comments are checked, prior to being published on this site. Please read the Comments Publishing Policy.

Planet Bods Sites in the network