ginader / HTML5-placeholder-polyfill

Small and robust polyfill for the HTML5 placeholder attribut.
GNU General Public License v2.0
223 stars 85 forks source link

Recognize `aria-label` and `aria-labelledby` attributes #27

Closed waiting-for-dev closed 11 years ago

waiting-for-dev commented 11 years ago

For me it's ok that it is needed to use a label, as discussed in issue #2, but then the aria attributes aria-label and aria-labelledby should be recognized, and it is not the case. I need to use this polyfill with an input that has no label tag but it does have an aria-labelledby attribute, as it is accepted by the WAI-ARIA.

Thanks a lot!

ginader commented 11 years ago

This does (sadly) not quite apply. The Polyfill is build to help older Browsers understand a functionality that newer Browsers understand by default. The Problem with those older Browsers is that they sadly won't understand WAI-ARIA either :-(

waiting-for-dev commented 11 years ago

Hey! Thanks for your repply.

But, as far as I have understood reading issue #2, the label presence is specifically required to force people to write a good code. The fact that old browsers does not understand WAI-ARIA attributes has nothing to do with all of this. The idea is that not providing a label but providing an aria-label or aria-labelledby attribute is as well a good practice, and it should be recognized to allow render a fake placeholder for old browsers.

I think that with jQuery you can recognize if an element has an attribute even if it is not recognized by the browser... or maybe am I wrong? Otherwise the data- attributes wouldn't be so helpful as they are now.

Thanks!!