JavaScript Library To Create Animated Placeholder Text In Text Field

Category: Form , Javascript | July 25, 2016
Authorderekxwu
Last UpdateJuly 25, 2016
LicenseMIT
Views858 views
JavaScript Library To Create Animated Placeholder Text In Text Field

active-placeholder is a lightweight JavaScript to animate placeholder text in the input field.

Basic usage:

Just download and include the active-placeholder’s script in the document and we’re ready to go.

<script src="active-placeholder.js"></script>

Specify an array of strings for the animated placeholder text you want to rotate through.

var myInput = document.getElementById('myInput');
var activePlaceholder = new ActivePlaceholder(
myInput, 'I Love', ['JavaScript', 'Python']);

Start the animation.

activePlaceholder.start();

Stop the animation.

activePlaceholder.stop();

You Might Be Interested In:


Leave a Reply