Skip to content

An input placeholder polyfill for IE 8 and 9 that works.

Notifications You must be signed in to change notification settings

basickarl/placeholder-polyfill

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 

Repository files navigation

placeholder-polyfill

A placeholder polyfill that fills in placeholder values for input types on Internet Explorer version 8 and 9. Just include the placeholder.js file script in your build somehow and call placeholderPolyfill() when the window has loaded.

Example:

<!DOCTYPE html>
<html>
    <head>
        <title>placeholder-polyfill</title>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <style>
            .placeholder {
                color: red;
            }
            .my-custom-placeholder {
                color: green;
            }
        </style>
    </head>
    <body>
        <input type="text" placeholder="placeholder text"><br>
        <input type="text" placeholder="my custom placeholder text" placeholderclassname="my-custom-placeholder">

        <script src="placeholder.js"></script>
        <script>
            window.onload = function() {
                placeholderPolyfill();
            }
        </script>
    </body>
</html>

About

An input placeholder polyfill for IE 8 and 9 that works.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published