HTML DOM Input Checkbox Checked Property - W3Schools
Có thể bạn quan tâm
Input Checkbox checked Property
❮ Input Checkbox Object
Example
Set the checked state of a checkbox:
function check() { document.getElementById("myCheck").checked = true; } function uncheck() { document.getElementById("myCheck").checked = false; } Try it Yourself »Description
The checked property sets or returns the checked state of a checkbox.
This property reflects the HTML checked attribute.
Browser Support
| Property | |||||
|---|---|---|---|---|---|
| checked | Yes | Yes | Yes | Yes | Yes |
Syntax
Return the checked property:
checkboxObject.checkedSet the checked property:
checkboxObject.checked = true|falseProperty Values
| Value | Description |
|---|---|
| true|false | Specifies whether a checkbox should be checked or not.
|
Technical Details
| Return Value: | A Boolean, returns true if the checkbox is checked, and false if the checkbox is not checked |
|---|
More Examples
Example
Find out if a checkbox is checked or not:
var x = document.getElementById("myCheck").checked; Try it Yourself »Example
Use a checkbox to convert text in an input field to uppercase:
document.getElementById("fname").value = document.getElementById("fname").value.toUpperCase(); Try it Yourself »Example
Several checkboxes in a form:
var coffee = document.forms[0];var txt = "";var i;for (i = 0; i < coffee.length; i++) { if (coffee[i].checked) { txt = txt + coffee[i].value + " "; }} document.getElementById("order").value = "You ordered a coffee with: " + txt; Try it Yourself »Related Pages
HTML reference: HTML <input> checked attribute
❮ Input Checkbox Object ★ +1 Sign in to track progressTừ khóa » C Checkbox Kontrolü
-
8-C # Checkbox Usage, Microsoft Visual Studio 2017 C # Form ...
-
C# Checkbox Örnekleri - Web Tasarım & Programlama
-
How To: Respond To Windows Forms CheckBox Clicks - Microsoft Docs
-
Visual C# - CheckBox Kullanımı - Asp.NET Dersleri
-
Top 21 C Checkbox Kontrolü En Iyi 2022 - XmdForex_Tr
-
Top 19 C Checkbox Checked Kontrolü En Iyi 2022 - XmdForex_Tr
-
C# CHECKBOX KONTROLÜ KOD İLE OLUŞTURMA Ve KULLANIMI
-
Javascript Checkbox Checked Kontrolü Code Example - Code Grepper
-
How To Check If DataGridView CheckBox Is Checked? - Stack Overflow
-
C# Kontroller CheckBox,RaidoButton
-
CheckBox Özellikleri C# Ders 14 - Gorsel Programlama
-
CheckBox Kullanımı Ve Özellikleri - ALKANFATIH
-
C# Birden Fazla Checkbox Kontrolü Arşivleri - Bilişim Konuları
-
Checkbox Ve CheckBoxList Kullanımı - Ozan A. KARTAL