Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

asp.net - Warning in a plain and simple HTML5 select element

I'm going around for quite some hours now how to resolve this warning. Although I know that the code will run just fine but I can't stand to see this warning. I have this

<select multiple class="form-control">
 <option>1</option>
 <option>2</option>
 <option>3</option>
 <option>4</option>
 <option>5</option>
</select>

and Visual Studio is giving me this Warning

Warning 1 Validation (XHTML5): This attribute name must be followed by an equal (=) sign and a value. If the value is in quotation marks, the quotation marks must match.

although w3schools.com states and I'm sure that the correct code is my code above. And I've read somewhere that in Visual Studio 2013 they resolved this issue (I'm using 2012) But in the comment section they said that they're using 2015 but still the warning pops. Any fix?

like image 256
Fiendcoder1 Avatar asked Nov 01 '25 11:11

Fiendcoder1


1 Answers

In XHTML, attribute minimization is forbidden, and the multiple attribute must be defined as

<select multiple="multiple">
like image 199
Russell Jonakin Avatar answered Nov 03 '25 01:11

Russell Jonakin