0

I am trying to use the Jquery UI to use radio inputs as buttons. This is the code I've got so far:

    <div id="time-buttons"
    <input type="radio" id="radio1" name="radio" /><label for="radio1">Choice 1</label>
    <input type="radio" id="radio2" name="radio" checked="checked" /><label for="radio2">Choice 2</label>
    <input type="radio" id="radio3" name="radio" /><label for="radio3">Choice 3</label>
    <input type="radio" id="radio4" name="radio" /><label for="radio4">Choice 4</label>
    <input type="radio" id="radio5" name="radio" /><label for="radio5">Choice 5</label>
    </div>

and the javascript:

   $( "#time-buttons" ).buttonset();

The problem that I have is that radio1 is not being changed into a button, but all of the others are. When I've looked inside Firebug, it looks as though the tag isn't present for Choice 1. Does anyone know why this is happening?

Thanks for any help

Edit: Sorry, just realised a very stupid mistake...basically I missed off the closing div >. Stupid me!

1
  • 3
    maybe it's only a typo you made here, but you forgot the closing bracket of the opening divtag... Commented Sep 28, 2011 at 13:19

1 Answer 1

2

As the highlighter probably helped you figure out, your first <div> tag isn't complete. Errors like this are easier to see in an editor that does syntax highlighting, and are often reported in Chrome's console (in the developer tools).

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.