html - jQuery to hide an element but it's not working -


i have page in sharepoint (aspx). trying hide td control using jquery. have attached rendered html developer tool , jquery. jsfiddle here https://jsfiddle.net/savo0mme/1/

html code

<table class="ms-wpbody" style="padding-top: 0px; width: 100%;">                     <tbody><tr>                         <td valign="top" style="padding-left:4px;padding-right:4px;"></td><td id="ctl00_m_g_1c59424a_162b_4285_8f9a_33109bdfc04f_defaultvaluemessage" width="100%" style="padding-left:4px;padding-right:4px;">the default value specified not valid.</td>                     </tr>                 </tbody>  </table> 

jquery code

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"> </script>  <script type="text/javascript">     $(function() {          var filtererrortext = "ctl00_m_g_1c59424a_162b_4285_8f9a_33109bdfc04f_defaultvaluemessage";         var filtererrortextid = document.getelementbyid(ctl00_m_g_1c59424a_162b_4285_8f9a_33109bdfc04f_defaultvaluemessage).innertext;         alert(document.getelementbyid("ctl00_m_g_1c59424a_162b_4285_8f9a_33109bdfc04f_defaultvaluemessage").innertext);         alert(filtererrortextid);     /*  if(filtererrortextid)         {             alert(filtererrortextid);             //filtererrortextid.style.display="none";         } */     });  </script> 

your script not use jquery. should use jquery hide() function

$('#ctl00_m_g_1c59424a_162b_4285_8f9a_33109bdfc04f_defaultvaluemessage').hide(); 

Comments

Popular posts from this blog

inversion of control - Autofac named registration constructor injection -

verilog - Systemverilog dynamic casting issues -

ios - Change Storyboard View using Seague -