:blank Selector

:blank Selector

Selector: :blank

Selects all elements with a blank value.

Description

Blank means either no value at all or only whitespace. The implementation does a check like this: jQuery.trim(value).length == 0

Usage

:blank Selector

This signature does not accept any arguments.

Examples

Finds input elements with no value or just whitespace.

$( "input:blank" ).css( "background-color", "#bbbbff" );
<div>Mouseover to see the value of each input</div>
<input value="" title='""'>
<input value="   " title='"   "'>
<input value="abc" title='"abc"'>