Is there a jQuery plugin to display default text in a text box?

When I click on the page, “Search ...” is displayed in the text box, in gray font.

Then I click on the text box. Then the "search ..." disappears. And I can print.

+3
source share
4 answers

What you are looking for is called the watermark effect. You can find the relevant jQuery plugins here .

+3
source

This is usually called "default text" and yes, there is a plugin.

JQuery default text plugin

, . , , , , "", . , , , .

+1

: http://tholljos.lu/mike/files/watermark.zip

jQuery(selector).watermark('here be text...','cssClass');

'here be text' . 'cssClass' - css, , .

AFAIAC , . , , , .

0
source
$("textinput_id").focus(function(){
    $(this).text("");
    });

$("textinput_id").blur(function(){
    $(this).text("Search...");
    });
-1
source

Source: https://habr.com/ru/post/1780161/


All Articles