jQuery Tutorial Tutorials - jQuery :text selector

:text selector

The jQuery :text selector is used to select all elements of type text.

$( "input:text" ) is not equivalent to $( "input[type=text]" ) in jQuery.Because :text selects input elements that have no specified type attribute.

<input id="testID">
<script>
    $( "#testID" ).is( "[type=text]" ); // false
    $( "#testID" ).is( ":text" ); // true
</script>

jQuery :text selector Syntax

$(':text')

jQuery :text selector Examples

In below example,We will hightlight all text inputs.
Try now

Date:2019-08-19 02:21:18 From:www.Lautturi.com author:Lautturi