File: example.html

Recommend this page to a friend!
  Classes of Gianluca Zanferrari   Animated Placeholder Text   example.html   Download  
File: example.html
Role: Example script
Content type: text/plain
Description: example
Class: Animated Placeholder Text
Show animated text as placeholders for text inputs
Author: By
Last change:
Date: 8 years ago
Size: 1,149 bytes
 

Contents

Class file image Download
<!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>