useranon
useranon

Reputation: 29514

Generate a radio button in JQUery

  • Multiple Choices
  • onclick of this radio i am trying to generate a radio button with two choices .. How to do so in JQUery??

    Upvotes: 0

    Views: 112

    Answers (1)

    JeremyWeir
    JeremyWeir

    Reputation: 24368

    I'm not sure if you really meant "radio", but if you did, maybe you want something as simple as:

    $("#radio").click(function(){
        $("#myRadioContainerSelector").html("<input type='radio' id='yes' name='myRadio' value='yes' /><label for='yes'>Yes</label><input type='radio' id='no' name='myRadio' value='no' /><label for='no'>No</label>");
    });
    

    Upvotes: 3

    Related Questions