javascript - Hide containing specific ID's -


I have an array of numbers from a number of tables and array_keys on one page.

I used to call each & lt; Tr & gt; has given an incremental ID, starting with 0. If my array returns 0,1,3,5 then I & lt; Tr & gt; To hide, with an ID of 2 and 4 usually I use CSS and apply a style: display = none

I think I should use jQuery .find () in an array loop such as:

  $ Arr = array_keys ($ floor_item, $ po); // floor_item is my array & amp; PO value I am searching for foreach ($ key as $ key => item $) {print "& lt; tr id = '". $ Item "'& gt; & lt; td & gt;" . $ Item "& lt; / td> gt; & lt; / tr & gt;"; // This will show me that I want the ID // just here $ ("tr") is estimated. The fund ("$ item") .hide (); }    

If you need to use client side code to hide elements , Then try something like this:

  var jsArray = [& lt ;? Php echo ($ "ude_you_want_to_show_array"); & gt; $ ("# your_table_id tr"). Hide (); $ .each (jsArray, function (key, value) {$ ("# tr_" + Value) .show ();});   

IDs of your TD are assuming "tr_0" "tr_1", and so on. By the way, the numbers are not used as IDs.

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -