Game Development Reference
In-Depth Information
A much more dynamic solution, as shown in the following screenshot, is to use a
combination of JavaScript and CSS to move the field label inside the field itself:
Before HTML5, this effect took quite a few lines of boilerplate JavaScript code:
<style>
.hint-on { color: #ddd; }
.hint-off { color: #333; }
</style>
<input type="text" name="firstName"
value="First Name" class="hint-on"
onblur="if (this.value == '') {
this.className='hint-on';
this.value='First Name';
}"
onfocus="if (this.value == 'First Name')
{
this.className='hint-off';
Search WWH ::




Custom Search