title: Why doesn't ASP.net RadioButtonList onchange client side event trigger?
body: <p>i have asp.net project, where i have a master-page on I include this line, to reference of the JS file</p>
  
  <pre><code>&lt;script type="text/javascript" src="Scripts/HideDIV.js"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>In the JS file i have this function:</p>
  
  <pre><code>function hideDiv() {
      document.getElementById('div1').style.display = 'none';
      document.getElementById('div2').style.display = 'none';
  
      if (document.getElementById('RadioButtonTipoUser_0') != null) {
          if (document.getElementById('RadioButtonTipoUser_0').checked) {
              document.getElementById('div1').style.display = 'block';
          }
      }
  
      if (document.getElementById('RadioButtonTipoUser_1') != null) {
          if (document.getElementById('RadioButtonTipoUser_1').checked) {
  
              document.getElementById('div2').style.display = 'block';
  
          }
      }
  }
  </code></pre>
  
  <p>Basically i need on this RadioButtonList, call a function on Js "hideDiv()", when a select the one Button, one div hide pass to visible.</p>
  
  <p>This code is in content.</p>
  
  <pre><code>&lt;div&gt;
          &lt;asp:RadioButtonList ID="RadioButtonTipoUser" runat="server" RepeatDirection="Horizontal" onchange="hideDiv()"&gt;
  
              &lt;asp:ListItem Selected="true" Value="1"&gt;Dome&lt;/asp:ListItem&gt;
              &lt;asp:ListItem Value="2"&gt;Emp&lt;/asp:ListItem&gt;
              &lt;asp:ListItem Value="3"&gt;Vet&lt;/asp:ListItem&gt;
          &lt;/asp:RadioButtonList&gt;
  
  
      &lt;/div&gt;
  
      &lt;div id="div1" style="display:none"&gt;
          &lt;a&gt;Charls&lt;/a&gt;
      &lt;/div&gt;
      &lt;div id="div2" style="display:none"&gt;&lt;a&gt;Maris&lt;/a&gt;&lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>I make a debug and the error msg is </p>
  
  <blockquote>
    <p>ReferenceError: hideDiv is not defined</p>
  </blockquote>
  
  <p>how i make tho the onchange="hideDiv()" call the HideDiv() function?</p>
  
  <p>Bests</p>