html - How to call a table using its Id in a javascript with if-else statements -


am trying show table using value "graph". if graph value 0 should display table1(id of table), if value of graph 10 , should display table2(id of table). trying show java script if else case. don't know how call table within java script in if else statements

               <script>     $(document).ready( function () {          myfunc();      });     function myfunc(){          console.log("input value", document.getelementbyid("graph").value)           if (document.getelementbyid('graph').value==00){           }       }</script> 

how write here call table in if else statement

try doing jquery if possible . hope helps !

$(document).ready(function(){    if($('#graph').val()=='00'){         $('#table1').show();         $('#table2').hide();      }else if($('#graph').val()=='10'){             $('#table2').show();             $('#table1').hide();              } }); 

Comments

Popular posts from this blog

java - Plugin org.apache.maven.plugins:maven-install-plugin:2.4 or one of its dependencies could not be resolved -

Round ImageView Android -

How can I utilize Yahoo Weather API in android -