Skip to content
Advertisement

Remove HTML Elements with values using javascript

I’m trying to remove <select>….</select> html element with all of it’s it’s values (option) on click event. like

JavaScript

Want to output like this:

JavaScript

I’m using code like:

JavaScript

Above code working fine but unable to remove value inside <option>opt ..</option>

Can anyone help me please.

Advertisement

Answer

Remove the <select> elements with .remove().

JavaScript
JavaScript
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement