Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
53 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,35 @@ | ||
PlaceholderSupport | ||
================ | ||
Adds a fallback for browsers that do not support the placeholder property. | ||
Probably the most simple solution for this out there. | ||
I found many others where you need extra CSS. This is so simple you just call the class and you have placeholder support in all browsers! | ||
Adds a fallback for browsers that do not support the placeholder attribute.<br> | ||
Probably the most simple solution for this out there.<br> | ||
I found many others where you need extra CSS. This is so simple that you just have to call the class and you have placeholder support for all browsers! | ||
|
||
<b>Published under the MIT-License</b>. | ||
|
||
![Screenshot](https://github.com/frozeman/PlaceholderSupport/raw/master/screenshot.png) | ||
|
||
How to use | ||
---------- | ||
Just add the PlaceholderSupport.js to your website and call: | ||
|
||
|
||
#JS | ||
window.addEvent('domready',function(){ | ||
|
||
new PlaceholderSupport(); | ||
|
||
}); | ||
|
||
|
||
Will add placeholder functionality to all inputs and textarea elements with a "placeholder" attribute. | ||
|
||
|
||
#JS | ||
new PlaceholderSupport(); | ||
window.addEvent('domready',function(){ | ||
|
||
or | ||
new PlaceholderSupport('input.myInputWithPlaceholder'); | ||
|
||
new PlaceholderSupport(elements); | ||
}); | ||
|
||
Leave the "elements" parameter empty, to add placeholder functionality to all inputs and textarea elements with a "placeholder" attribute. | ||
|
||
Otherwise the "elements" parameter can be a string with CSS selectors or an array with elements. | ||
Will add the placeholder only to inputs with the class "myInputWithPlaceholder". But this input needs also a placeholder attribute with a text! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
name: PlaceholderSupport | ||
author: frozeman | ||
current: 1.0 | ||
category: Utilities | ||
tags: [Placeholder] | ||
category: Forms | ||
tags: [Placeholder,html5] |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.