How to select a radio button by default?

XHTML solution: Please note, that the actual value of checked attribute does not actually matter; it’s just a convention to assign “checked”. Most importantly, strings like “true” or “false” don’t have any special meaning. If you don’t aim for XHTML conformance, you can simplify the code to: