I want to have a radio button to be selected as default in VF page.

<input type="radio" name="protocol" value="http" checked/>http
<input type="radio" name="protocol" value="https"/>https <br/>

But this throws up an error while saving the VF page

Attribute name "checked" associated with an element type "input" must be followed by the ' = ' character.

Any idea what is the right syntax?

2 Answers 2


You need to use following syntax:

  • I couldnt find an answer when i googled it, thought it would be good if i put it out here if someone else had the same issue
    – Prady
    Sep 5, 2014 at 12:32

It had to be checked="checked"

<input type="radio" name="protocol" value="http" checked="checked" />http

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.