title: how to get parent id on Dropdownlist's OnTextChanged event using jquery or javascript?
body: <p>i want to use jquery's function on dropdownlist's OnTextChanged Event. but i dont know why its not firing. my code is,</p>
  
  <pre><code>    &lt;asp:GridView ID="grd_test" runat="server" Style="text-align: center;
                  width: 375px;" AutoGenerateColumns="false"&gt;
  
                  &lt;Columns&gt;
  
                      &lt;asp:TemplateField HeaderText="Test"&gt;
                          &lt;ItemTemplate&gt;
                              &lt;asp:DropDownList ID="drp_test"  OnTextChanged='&lt;%# "return CheckVal(this);" %&gt;' runat="server"&gt;
                                  &lt;asp:ListItem Value=""&gt;0&lt;/asp:ListItem&gt;
                                  &lt;asp:ListItem Value="1"&gt; 1&lt;/asp:ListItem&gt;
                                  &lt;asp:ListItem Value="2"&gt;2&lt;/asp:ListItem&gt;
                                  &lt;asp:ListItem Value="3"&gt;3&lt;/asp:ListItem&gt;
                              &lt;/asp:DropDownList&gt;
                          &lt;/ItemTemplate&gt;
                      &lt;/asp:TemplateField&gt;
                  &lt;/Columns&gt;
              &lt;/asp:GridView&gt;
  </code></pre>
  
  <p>my javascript's code is </p>
  
  <pre><code>    function CheckVal(obj) {
          var collection = document.getElementById(obj.parentNode.id).getElementsByTagName('SELECT');
  
          for (var x = 0; x &lt; collection.length - 1; x++) {
              if (collection[x].type.toUpperCase() == 'SELECT-ONE') {
                  alert(collection[x].value);
              }
  </code></pre>
  
  <p>}
          }</p>