Include placeholder in input fields with this simple place-holder.js
place-holder.js is a less than 1 KB(444 bytes) Javascript file based on Jquery which is used to include placeholder in your input fileds. Don’t need to include placeholder manually of every input field just include place-holder.js.
First include jQuery to your web page. There are several ways to start using jQuery on your web site. You can: Download the jQuery library from jQuery.com Include jQuery from a CDN, like Google, Microsoft
Downloading jQuery The jQuery library is a single JavaScript file, and you reference it with the HTML ‘script’ tag (notice that the ‘script’ tag should be outside the ‘body’ section at the bottom):
<script type ="text/javascript" src ="jquery-3.0.0.min.js"></script>
After including jQuery you need to include placeholder.js in your web page by downloading this project or clone is project Include place-holder.js after the jquery library
<script type="text/javascript" src="place-holder.min.js"></script>
Note: Place the downloaded file in the same directory as the pages where you wish to use it.
npm install place-holder.js
https://unpkg.com/place-holder.js@2.2.4
bower install place-holder.js
###Information for the place-holder.js
bower info place-holder.js
<!DOCTYPE html>
<html>
<head>
<title>Index</title>
</head>
<body>
<form>
<input type="text" name="name">
<input type="email" name="email">
<input name="mobile">
<input type="submit">
<textarea></textarea>
</form>
</body>
<script type="text/javascript" src="jquery-3.0.0.min.js"></script>
<script type="text/javascript" src="place-holder.min.js"></script>
</html>
Feel free to contribute
Copyright (c) 2016 Ankit Jain - Released under the MIT License