i searched google to do this and mostly i found this solution:

mydiv = document.getElementById('FirstDiv');while ( mydiv.firstChild ) mydiv.removeChild( mydiv.firstChild );

instead of doing such iterations, i basically did this and it worked successfully:

document.getElementById('FirstDiv').innerHTML ="";

It doesn't work in all cases. Check for form's select object. I know that IE sucks, but tell it to most internet users.

The first solution is better one.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.