How Jquery/Javascript dynamically add td (table) -



How Jquery/Javascript dynamically add td (table) -

i need help, ideas?

firstly want hide input element when page open, approach creating dropdown $counter (1-8) , depending on $counter example:3.

i create/show existing element dynamically ($counter)<td></td> within tr #id.

how jquery solve problem?

can u provide me illustration of switch case in jquery show/hide defined td #id?

thanks before

rizq

suppose input has id of "input-1", can hide doing:

// assign value counter, might function var counter = '1'; // reference element , hide var input = document.getelementbyid('input-' + counter); input.style.display = 'none'; // or input.style.visibility = 'hidden';

and show again:

input.style.display = ''; // empty string // or input.style.visibility = 'visible';

the difference between display , visibility properties former remove element document flow, whereas sec create invisible (read relevant parts of w3c css spec). messing display might create document jump bit reflows, messing visibility keeps stable leaves blank space. selection suits best.

you can hide , show kind of element using same method. if want parent cell or row, go parentnode chain till nail first td or tr appropriate , hide it.

there bit of tutorial on mozilla developer site messing table elements using dom apis.

javascript jquery

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

intellij idea - Update external libraries with intelij and java -

javascript - send data from a new window to previous window in php -