Dynamic Content Using Radio Buttons

Dynamic Content Using Radio Buttons

Question:

I wrote JavaScript code that displays different text depending on the radio button clicked. I used innerHTML to display text, which works fine on Internet Explorer 5 but not on Netscape 4.6. What should I do?

Answer:

A somewhat equivalent technique to use with Navigator 4.x is a combination of document.write and document.close. However, this will only work with layer type objects?objects defined using the LAYER tag (don’t use this), or content contained in positioned DIV or SPAN blocks. To replace contents, use something similar to this code (if you’ve attached an identifier of “test” to the block):

document.test.document.write("

test

");document.test.document.close();

Navigator creates a new document object for each layer, and document supports the write method to create the document’s contents. The close method then forces a redraw. One area where innerHTML and document.write differ is that document.write does not preserve any CSS styling for the block.

Share the Post:
data observability

Data Observability Explained

Data is the lifeblood of any successful business, as it is the driving force behind critical decision-making, insight generation, and strategic development. However, due to its intricate nature, ensuring the

Heading photo, Metadata.

What is Metadata?

What is metadata? Well, It’s an odd concept to wrap your head around. Metadata is essentially the secondary layer of data that tracks details about the “regular” data. The regular

XDR solutions

The Benefits of Using XDR Solutions

Cybercriminals constantly adapt their strategies, developing newer, more powerful, and intelligent ways to attack your network. Since security professionals must innovate as well, more conventional endpoint detection solutions have evolved