title: i am unable to change background color of label of radgrid on the basis of "if condition"
body: <p>i am working on radgrid in asp.net.i take label in the radgrid for display status of person.i want that if ststus is "availabe" the backgroung color of label is green and if status is "Not Availabe" then backround color is red.i try it by javascript but i am unable to access each record of the grid.</p>
  
  <p><a href="https://i.stack.imgur.com/agMC9.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/agMC9.png" alt="enter image description here"></a>
  the Html code is:</p>
  
  <pre><code>  &lt;telerik:GridTemplateColumn  DataField="Editor_status" HeaderText="Editor_status" ReadOnly="true"&gt;
     &lt;ItemTemplate&gt;
     &lt;asp:Label ID="Editor_status"   runat="server" Text='&lt;%#Eval("Editor_status")%&gt;' BackColor="SkyBlue" Font-Size="14px" CssClass= "badge badge-pill  hvr-grow  badge-success" &gt;&lt;/asp:Label&gt;
     &lt;/ItemTemplate&gt;
     &lt;/telerik:GridTemplateColumn&gt;
  </code></pre>
  
  <p>i tried access the label "Editor_status" by javascript by folowing  way:</p>
  
  <pre><code>   &lt;script&gt;
     $(document).ready(function () {
          var a = document.getElementById("Editor_status").innerText
          function myFunction() {
              if (a == "Available") {
                  window.alert("avlble");
              }
              else {
                  window.alert("not avlble");
              }
          }
  &lt;/script&gt;
  </code></pre>
  
  <p>but by this way no alert is display..i am weak in javascript ,so don't mind my initial level question....u also answer me in vb.net or javascript. </p>