Home | Previous | Next

Document Object Model (2)

Show - hide - collapse... w3school.com example

Implicit collapse:
Explicit collapse (text_group_2 [display]):
This text is not shown when the page is loaded
Explicit hide (take up space)(text_group_3 [visibility]):

Toggle text [insert_text()]

Text group 2: Toggle visability [toggle_visability('2')] | Toggle dispaly |

Text group 3: Toggle visability [toggle_visability('3')] | Toggle dispaly |

There is a functional problem with the two toggle functions. How to solve that?

Show HTML code [show_html()]


The java script to do this is:
document.getElementById('htmlTextBox').value = document.getElementById('text_group').innerHTML;