Idea
Suppose you have an online CD rating tool. You want users to view all their favorite CDs. But how do you know how many images a user will view on average? How many fields do you need to add to this page?
This was indeed a problem before W3CDOM came along. Let's say you placed 7 CDs. But users may only want to view one CD, and too many may scare users. Some users want to view all their CDs, so they have to submit them many times. This is really annoying.
Only using W3C DOM allows the user to decide how many fields to generate. This effect is very different from the previous one.
Example
When you click Send, the form will send all the parameters obtained in the form of an array. This is used to check whether it was actually sent to the server. Unfortunately, the mac versions of IE and Safari cannot send.
Problems with IE
IE under windows has two serious problems:
The first problem is that all generated radio button boxes belong to the same array, even if their names are different. In this way, the user can only select one of all radio button boxes. In other words, you cannot use radio buttons in the generated form.
Some readers said that there is no problem with the radio button generated through innerHTML. If you insist on using radio buttons, you can try it.
The second problem is that the generated forms are not accessible through traditional document.forms: IE does not include them in the array. This can be solved by setting IDs for them.
Explain the HTML code of the
form: