title: How to create radio buttons dynamically using jquery mobile?
body: <p>When creating radio buttons dynamically using for loop condition, radio buttons are not creating. The code i am following is</p>
  
  <p>Polldetails.html</p>
  
  <pre><code>      &lt;div data-role="content" class="pollsdetailsscreen"&gt;
              &lt;p&gt;Polls details page with radio buttons created dynamically.&lt;/p&gt;
          &lt;/div&gt;
          &lt;div&gt;   
               &lt;ul id="radiopolls" data-theme="e" &gt;
              &lt;/ul&gt;
              comments:&lt;textarea name="pollscomments" id="pollscomments"&gt;&lt;/textarea&gt;
              &lt;div data-role="content"  &gt;
                  &lt;a href="#" data-role="button" style="width: 100px;float:right"&gt;Submit&lt;/a&gt;
              &lt;/div&gt;  
          &lt;/div&gt;
  </code></pre>
  
  <p>Polldetails.js </p>
  
  <pre><code>     var pollsDetails = function pollsDetails(){
  
  //for(var i=0;i&lt;4;i++)
  //  {
  //var radiobutton = document.createElement('label');
  //radiobutton.innerHTML="&lt;input type='radio' name='hello'&gt;hii000";
  // $('#radiopolls').prepend(radiobutton).trigger('create');
  //  }
  
  
  for(var i=0; i&lt;4; i++)
      {
          if(data.type == "poll")
              {
                               console.log("this is polls page");
                              //here i need to create four radio buttons dynamically based on below **data** options. 
              }
          else if(data.type == "review")
              {
                console.log("this is reviews page");              
              }                       
      }
       }
  
  
  
          var data = {
         type:"poll",
         question : "How are you?",
         options : [{
             type : "radio",
             name: "radioTest",
             text: "Good"
         },
         {
             type:"radio",
             name: "radioTest",
             text: "Fine"
         },
         {
             type:"radio",
             name: "radioTest2",
             text: "Nice"
         },
         {
             type:"radio",
             name: "radioTest2",
             text: "V Nice"
         },
         {
             type:"checkbox",
             name:"check",
             text:"This is a check box"
         },
         {
             type:"textarea",
             name:"comments",
             text:"Comments Please"
         }    
         ]
      };
  </code></pre>
  
  <p>As per the code by checking condition, i need to create 4 radio buttons dynamically when the condition is <strong>data.type = "poll"</strong> but i am unable to create radio buttons dynamically based on code.. can anyone please help me with this..........</p>