2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Jquery Form Selectors

Posted at

Form Selectors in JQuery

  • A Form Selector selects the HTML element which has type=input field within the form element.
  • It is one of the pseudo-class selectors start with [:].
  • We must indicate [input:file] in jquery otherwise it take [*:file].
  • Here we can see the example of input tag in html.
    <input type="text" value="content" enabled="enebled">

:button

  • This jquery selector operates which input type has a button.
  • The jquery execute only an element within the form elements.
  • A type=button element will pass a signal to alert when the click event execute.

Example

$(document).ready(function () { $(':button').click(function () { alert("hai"); }); });

:checkbox

In this jquery selector perform the checkbox element which declare the input type="checkbox" within form element.

Example

$(document).ready(function () { $(':button').click(function () { alert($(':checkbox').val()); }); });

:checked

  • We can use this property for checkbox and radio button that mention in form.
  • The checked elements are only manipulated by jquery.

Read More from https://api.jquery.com

2
1
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?