<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery-latest.min.js"></script>
<script src="placeholder.js"></script>
</head>
<body>
<h2>Animated placeholder text</h2>
<form>
<p>Your name:</p>
<input type="text" name="name" id="name" style="width: 250px; padding: 3px; font-size: 17px">
<p>Your Age:</p>
<input type="text" name="age" id="age" style="width: 250px; padding: 3px; font-size: 17px">
<p>Your Adress:</p>
<input type="text" name="address" id="address" style="width: 250px; padding: 3px; font-size: 17px">
</form>
<script>
var obj = new placeholder();
obj.interval_time(5000); // optional, default 4000 milliseconds
// pass an object as parameter
// key(s) : input field names
// value(s) : text to show as placeholder
obj.set_fields({'name': 'Please enter your name...', 'age': 'Please enter your age...', 'address': 'Please enter your address...'});
</script>
</body>
</html>
|