Git Product home page Git Product logo

jquery-placeholder's Introduction

Placeholder plugin for jQuery

A jQuery plugin that enables HTML5 placeholder support for legacy browsers

The HTML5 placeholder attribute is awesome, unfortunately only supported by some browsers. This

plugin replicates the placeholder behavior for unsupported browsers.

Compatibility:
^^^^^^^^^^^^^^
IE 6+
Firefox 3+
Safari 3+
Chrome ✓
Opera ✓
iPhone ✓

Android ✓

Please note
The placeholder attribute should not be used as an alternative to a label.

http://www.whatwg.org/specs/web-apps/current-work/multipage/common-input-element-attributes.html#the-placeholder-attribute

If you must hide labels, do it with JavaScript as you activate the placeholder.

Usage

It's easy!:

$('input[placeholder], textarea[placeholder]').placeholder();

Enjoy.

Styling

Native styling of HTML5 placeholders:

::-webkit-input-placeholder {color: red;}

:-moz-placeholder {color: red;}

jQuery-Placeholder toggles a .placeholder class for browser that don't natively support placeholders:

.placeholder { color: red }

Credit

Copyright 2011, Daniel Stocks ( http://webcloud.se )

Thanks to Nikita Vasilyev and James Rosen for feedback and contribution.

jquery-placeholder's People

Contributors

danielstocks avatar jeromegamez avatar mange avatar nv avatar paveltyk avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.