Skip to content

ElementWrapper.checked() ​

Definition ​

ts
checked(): boolean | undefined;
checked(value: boolean): this;

Description ​

Used for either getting or setting the checked attribute of elements.

Examples ​

Getting the checked attribute ​

html
<input type="checkbox" />
ts
$('input').checked();

Setting the checked attribute ​

html
<input type="checkbox" />
ts
$('input').checked(true);
$('input').checked(false);