title: Hide div with javascript after page loads based on ASPxComboBox after page load from database from code behind
body: <p>I have an aspx page that contains an ASPxComboBox.  When this combo is changed after the page loads the div hides/unhides fine.  In my case I load existing values from the database.  I need to hide/show div based on these loaded values.  If I populate the dropdown with &quot;None&quot;  I want to hide the divs.  Thanks.</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>&lt; script type = "text/javascript" &gt;
    function OnSizeChanged(cbSide) {
      const str = cbSide.GetText().toString();
      if (str.includes('None')) {
        bottomtext.style.display = "block";
        lblbottomtext.style.display = "block";
      } else {
        lblbottomtext.style.display = "none";
        bottomtext.style.display = "none";
      }
    } 
    &lt;/script&gt;</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;dx:ASPxComboBox ID="cbSide" runat="server" Width="280" ValueType="System.String"&gt;
    &lt;Items&gt;
      &lt;dx:ListEditItem Text="DXF" Value="DXF" /&gt;
      &lt;dx:ListEditItem Text="None" Value="None" /&gt;
    &lt;/Items&gt;
  
    &lt;ClientSideEvents SelectedIndexChanged="function(s, e) { OnSizeChanged(s); }" /&gt;
    &lt;ValidationSettings RequiredField-IsRequired="true" Display="Dynamic"&gt;
      &lt;RequiredField IsRequired="True"&gt;&lt;/RequiredField&gt;
    &lt;/ValidationSettings&gt;
  &lt;/dx:ASPxComboBox&gt;
  
  &lt;div id="lblbottomtext" runat="server"&gt;
    &lt;dx:ASPxLabel ID="lblBST" runat="server" Text="Bottom Side Text:"&gt;&lt;/dx:ASPxLabel&gt;
  &lt;/div&gt;
  &lt;div id="bottomtext" runat="server"&gt;
    &lt;dx:ASPxMemo ID="txtBottom" runat="server" Height="71px" Width="280px"&gt;&lt;/dx:ASPxMemo&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>