Placeholder Patch for Older Browsers - jQuery placeholderpatch

File Size: 4.52KB
Views Total: 514
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   
Placeholder Patch for Older Browsers - jQuery placeholderpatch

placeholderpatch is a jQuery plugin that enables Older Browsers to support HTML5 Placeholder attribute. The placeholder is an useful and user-friendly attribute introduced in HTML5 that shows preset text in a text field until the field is focused on, then hides the text. 

How to use it:

1. Include the latest jQuery library and placeholderpatch.js in the head section

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.js" type="text/javascript"></script>
<script src="jquery.placeholderpatch.js" type="text/javascript"></script>

2. Create a input field with a ID of 'demo'

<input type="text" id="demo" placeholder="jQueryScript.Net" />

3. Then call the plugin

<script type="text/javascript">
$('#demo').placeholder();
</script>

Change log:

v1.2.0 (2013-11-25)

  • The placeholder text must now be provided by only by the placeholder attribute
  • The patch is now only applied if placeholder attributes are not supported already by the browser

This awesome jQuery plugin is developed by alexrabarts. For more Advanced Usages, please check the demo page or visit the official website.