+ 1

About class and selected

why we use class and selected tags

9th Jul 2017, 3:06 PM
Mohammad Amir Qureshi
1 Answer
+ 3
'class' and 'selected' are not 'tags' but attributes of tags... + class can be set on any element tag, and define one or more class names to be use to style elements with Css: <div class="myclass">content</div> <style> .myclass { background:red; } </style> + selected is a boolean attribute (no need to assign a value) to defined selected element in a group of <option> html elements: <select> <option>option 1</option> <option selected>option 2</option> <option>option 3</option> </select> ... will display a dropdown list with the second element default selected...
9th Jul 2017, 6:10 PM
visph
visph - avatar