jquery - i tried to hide some tables in a div in a html page but doesn't work -


i tried hide tables in div in html page doesn't work . 1 of html pages contains 10 tables.. want show few tables while selecting particular department..currently ids of table need show..but how view tables only..

tried jquery attached here.. please me .. in stuck

    <script>                 $(function() {          $("#departments").change(function(v) {                   var gid=$(this).attr("id");                   var department_id = v.target.value                  //console.log(department_id);                  $("#showdata table").each(function(){                 //console.log($(this).attr("id"));                  var gid=$(this).attr("id");              $('#'+gid).hide();                  $.get("/bankprofile/selectgroup/"+department_id+"/"+gid,function(data){                         var obj = jquery.parsejson(data);                        // console.log(obj);                   for(i = 0; < obj.length; i++) {                  var gid=obj[i].group_id;                    console.log(gid);                 }                });                }); });  });                        </script> 

$("'" + "#" + gid + "'").hide();

try this.


Comments

Popular posts from this blog

tcpdump - How to check if server received packet (acknowledged) -