Declare javascript static array in function -
I have a table containing 21 checkboxes (7 days of rows three times a day Column). I need a onClick function to turn the personalized three-column date column on or off. I got this javascript function:
function toggle call {written ifof toggleCol.state == 'undefined') toggleCol.state = false; ToggleCol.state =! Togglecol.state; Document.getElementById ("req" + colnum) Checked = toggleCol.state; Document.getElementById ("req" + (colnum + 7)). Checked = toggleCol.state; Document.getElementById ("req" + (colnum + 14)). Checked = toggleCol.state; } This works but the obvious problem is that I do not need one, but seven toggle call.state variable, one for each column, Probably in the form of an array
How do I declare and use a steady array of seven members within the work? I have tried to think in every way, but I have participated in ideas!
If you want to select and hide all the cells in a column you can try: $ ( 'Td: nth-child (number_of_column)'). Hide ();
Comments
Post a Comment