X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=resources%2Fjquery%2Fjquery.placeholder.js;h=f7c9ae0f29544af740c09eb9f17e6a1a8b1db7f3;hb=7ec7d879ee20e9bf1dec618ec701fba3982a44b0;hp=7badb11ae872270d5b24f815617c772cc8287d7d;hpb=4498b01558ff849af9263101817cd3dcb9747e8d;p=lhc%2Fweb%2Fwiklou.git diff --git a/resources/jquery/jquery.placeholder.js b/resources/jquery/jquery.placeholder.js index 7badb11ae8..f7c9ae0f29 100644 --- a/resources/jquery/jquery.placeholder.js +++ b/resources/jquery/jquery.placeholder.js @@ -10,17 +10,21 @@ */ ( function ( $ ) { - $.fn.placeholder = function () { + $.fn.placeholder = function ( text ) { return this.each( function () { var placeholder, $input; + if ( arguments.length ) { + this.setAttribute( 'placeholder', text ); + } + // If the HTML5 placeholder attribute is supported, use it if ( this.placeholder && 'placeholder' in document.createElement( this.tagName ) ) { return; } - placeholder = this.getAttribute( 'placeholder' ); + placeholder = arguments.length ? text : this.getAttribute( 'placeholder' ); $input = $(this); // Show initially, if empty