Skip to content

Latest commit

 

History

History
30 lines (22 loc) · 573 Bytes

no-val.md

File metadata and controls

30 lines (22 loc) · 573 Bytes

no-val

Disallows the .val method. Prefer HTMLInputElement#value.

📋 This rule is enabled in plugin:no-jquery/all.

Rule details

❌ Examples of incorrect code:

$( 'div' ).val();
$div.val();
$( 'div' ).first().val();
$( 'div' ).append( $( 'input' ).val() );

✔️ Examples of correct code:

val();
[].val();
div.val();
div.val;

Resources