I have an HTML Element on a page that is a text/input box. I am looking to convert this type to a select/drop down but have not had any luck figuring out if this is possible. I am fairly new to javascript, and working with the DOM.
Is there a simple way to convert a HTML Element to a select?
I have tried looking at articles like this, but updating the type does not change anything in the UI:
Change Input type HTML using JavaScript
I dont think the above is what I am actually trying to do since this is trying to change the input type and not changing the type of element.
I am happy to provide screenshots to better explain, I am just not sure exactly what information would be helpful.
I have tried looking at articles like this, but updating the type does not change anything in the UI:
- Change Input type HTML using JavaScript
- https://www.universalwebservices.net/web-programming-resources/javascript/change-input-element-type-using-javascript/
- Converting a text input to a select element with JavaScript
This last link I think is what I am trying to do but this is for jQuery