title: how to check radiobuttonlist is checked or not in javascript
body: <p>I have tried using the following code for checking radiobutton selection but it shows alert even after selection </p>
  
  <pre><code>    &lt;script type="text/javascript"&gt;
      function validate() 
      {
      if (!document.getElementById('&lt;%= Radiobuttonlist1.ClientID %&gt;').checked) 
           {
                      alert("Please select type");
                      return false;
           }
      }
      &lt;/script&gt;
  
          &lt;asp:radiobuttonlist ID="Radiobuttonlist1" runat="server" 
                      RepeatDirection="Horizontal" &gt;
                  &lt;asp:ListItem&gt;Text&lt;/asp:ListItem&gt;
                  &lt;asp:ListItem&gt;Number&lt;/asp:ListItem&gt;
                  &lt;asp:ListItem&gt;Character&lt;/asp:ListItem&gt;
                  &lt;/asp:radiobuttonlist&gt;
  
          &lt;asp:Button ID="Button1" runat="server" Text="Button" OnClientClick="return validate();" onclick="Button1_Click"/&gt;
  </code></pre>