Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to show selected value of type="radio" on populate?
    primarykey
    data
    text
    <p>On clicking on the Populate Values button the div below the button should populate the values of the selected radio buttons of the preferred and home locations respectively</p> <p>I want to do it unobtrusively without inline JavaScript</p> <p><img src="https://i.stack.imgur.com/WaWZz.jpg" alt="alt text"></p> <pre><code>&lt;div id="form_block"&gt; &lt;div class="home-location"&gt; &lt;ul&gt; &lt;li&gt;Home Location&lt;/li&gt; &lt;li&gt; &lt;input type="radio" name="home-location" value="india" class="radio" id="home-india" /&gt;&lt;label for="home-india"&gt;India&lt;/label&gt;&lt;/li&gt; &lt;li&gt; &lt;input type="radio" name="home-location" value="usa" class="radio" id="home-usa" /&gt;&lt;label for="home-usa"&gt;USA&lt;/label&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;div class="prefer-location"&gt; &lt;ul&gt; &lt;li&gt;Preferred Location&lt;/li&gt; &lt;li&gt; &lt;input type="radio" name="home-preferred" value="india" class="radio" id="preferred-india" /&gt;&lt;label for="preferred-india"&gt;India&lt;/label&gt;&lt;/li&gt; &lt;li&gt; &lt;input type="radio" name="home-preferred" value="usa" class="radio" id="preferred-usa" /&gt;&lt;label for="preferred-usa"&gt;USA&lt;/label&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;div class="result"&gt; My Home Location is: &lt;span class="home-location-result"&gt;&lt;/span&gt;and my preferred location is: &lt;span class="home-location-result"&gt;&lt;/span&gt; &lt;/div&gt; &lt;input type="submit" value="Populate Values" id="ss" class="submit" /&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload