title: How do you create radio buttons through pure JavaScript by using an object to assign an element from an array?
body: <p>I was on discord and someone need help with this as they wanted to solve this problem.
  They precisely said <strong>&quot;I want to check if the selected button has the same value as the true element ( i m working with vanilla JavaScript)&quot;</strong></p>
  <p>This is what they did as an example;</p>
  <pre><code>var ask =  {
          name: jane,
          age: [18, 20, 24],
          true: 1 // the age of jane is 20
      }
      var option1 = document.createElement(&quot;input&quot;)
      option1.name = &quot;name&quot;
      option1.type = &quot;radio&quot;
      option2.value = ask.age[0]
      var option2 = document.createElement(&quot;input&quot;)
      option2.name = &quot;name&quot;
      option2.type = &quot;radio&quot;
  
      option2.value = ask.age[1]
      var option3 = document.createElement(&quot;input&quot;)
      option3.name = &quot;name&quot;
      option3.type = &quot;radio&quot;
      option3.value = ask.age[2]
  </code></pre>