If "required" & "disabled" are attributes of <form> element then why dont we use the format of attributes [name="value"] ? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

If "required" & "disabled" are attributes of <form> element then why dont we use the format of attributes [name="value"] ?

Why they are written as it is without name and quotation marks.....

11th Sep 2018, 4:38 AM
Satyendra Singh
Satyendra Singh - avatar
7 Answers
+ 7
Because writing this: <input type="text" disabled/> is just the same as this: <input type="text" disabled="true" /> Default 👆
11th Sep 2018, 5:58 AM
Email Not Activated
+ 3
The value can be any string Only the existence of the attribute makes it true. <button disabled=”sololearn”>Button</button> without any value the selector is just the attribute button[disabled] Or in this case button[disabled=”sololearn”]
11th Sep 2018, 9:00 AM
Toni Isotalo
Toni Isotalo - avatar
+ 2
You could write required="required", disabled="disabled"
11th Sep 2018, 4:50 AM
Calviղ
Calviղ - avatar
+ 1
I assume that if name and value are same we can write value itself
11th Sep 2018, 4:55 AM
Satyendra Singh
Satyendra Singh - avatar
+ 1
You're right
11th Sep 2018, 5:45 AM
Calviղ
Calviղ - avatar
+ 1
Is it [disabled="true"] or [disabled="disabled"] ?
11th Sep 2018, 6:00 AM
Satyendra Singh
Satyendra Singh - avatar
- 2
it's got to be something
22nd Sep 2018, 2:58 AM
Jared Garnick
Jared Garnick - avatar