I have a <form>
that looks like this:
<form>
<input type="text" name="name" id="name" /><span class="required"></span>
</form>
What I want to do is show some text, such as *
or Required
in the <span>
element, instead of "hard coding" the text for every such place I need the text so the form looks something like this:
[input box] Required
I googled around and found that it could be done by a CSS style using content
such as:
.required:before
{
content: "aaaa"
}
But, should I be using this technique (is it supported in every major browser for example) or is there a more preferred way to do this sort of thing?
Thanks
UPDATE Ps. I don't want to use JavaScript for this, just plain CSS.