DEVFYI - Developer Resource - FYI

Why does the option tag render selected=selected instead of just selected?

Struts Questions and Answers


(Continued from previous question...)

54. Why does the option tag render selected=selected instead of just selected?

Attribute minimization (that is, specifying an attribute with no value) is a place where HTML violates standard XML syntax rules. This matters a lot for people writing to browsers that support XHTML, where doing so makes the page invalid.It's much better for Struts to use the expanded syntax, which works the same on existing browsers interpreting HTML, and newer browsers that expect XHTML-compliant syntax. Struts is following the behavior recommended by the XHTML specification

(Continued on next question...)

Other Interview Questions