Hey,what is the practical use for CHECKED attribute in the buttons? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

Hey,what is the practical use for CHECKED attribute in the buttons?

What is it used for?

23rd May 2020, 4:58 PM
Oh Boi!
Oh Boi! - avatar
3 Answers
+ 2
Thank you but what is the practical use for this?i mean,why would anybody wanna pre-checked an option when that depends on the user input?
24th May 2020, 8:34 PM
Oh Boi!
Oh Boi! - avatar
+ 1
checked attribute use in input type checkbox. It's use to check the checkbox and checkbox use to select multiple value so if you do checked = "checked" then you can get checked value. For example; <input type = "checkbox" name = "human" value = "Male" checked = "checked" /> <input type = "checkbox" name = "human" value = "Female" /> In this case you will get only checked value.
23rd May 2020, 6:16 PM
A͢J
A͢J - avatar
+ 1
Oh Boi! Sometimes we don't want to select then default value should go in database. That's why we put one option pre-checked.
24th Jun 2020, 9:19 PM
A͢J
A͢J - avatar