Skip to content

Instantly share code, notes, and snippets.

@gcollazo
Last active February 4, 2024 23:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gcollazo/264847 to your computer and use it in GitHub Desktop.
Save gcollazo/264847 to your computer and use it in GitHub Desktop.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<title>magicFields</title>
<style type="text/css" media="screen">
.inlineLabel{
color:#B0B0B0;
}
</style>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script type="text/javascript" charset="utf-8">
$(document).ready(function(){
$('input.inlineLabel').focus(function() {
if(this.createTextRange){
// IE Hack Awrrr!
this.value = this.value;
} else {
this.setSelectionRange(0,0);
$(this).css("color", "#DFDFDF");
}
});
$('input.inlineLabel').blur(function() {
$(this).css("color", "#B0B0B0");
});
$('input.inlineLabel').click(function() {
this.setSelectionRange(0,0);
});
});
</script>
</head>
<body>
<form action="#" method="post" accept-charset="utf-8">
<input type="text" name="username" value="Username" id="username" class="inlineLabel" />
<input type="text" name="username" value="Email" id="email" class="inlineLabel" />
</form>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment