InputLabel jQuery Plugin demos

The inputLabel jQuery plugin uses a passed in string or a reference form label text to insert a "placeholder" text inside a form input field.

jQuery.inputLabel(text,opts) paramenters:

Download this script


Demo HTML

	<label for="myInput">Enter a value</label> <input type="text" name="myInput" id="myInput" />

Basic Usage

$("#myInput").inputLabel();

Custom text

$("#myInput").inputLabel("Custom label text");

$("#myInput").inputLabel($("#header h1")); //get the text from a DOM element 

Run the script just once

$("#myInput").inputLabel(false,{keep:false});

Custom text color

$("#myInput").inputLabel(false,{color:"#F00"}); //red color

Run the script even if the field has a defined value attribute

	<label for="myInput">Enter a value</label>
<input type="text" name="myInput" id="myInput" value="pre-filled value" />
	

force:false (default)

$("#myInput").inputLabel(false,{force:true});

force:true