I have an HTML <DATALIST>
that depends on a second field on the page. The second field has an onchange method that builds a string of innerHTML using an SQL query and sets the innerHTML for the datalist.
document.all.MyDataList.innerHTML='<built string>’
It works. I get the right data in the data list.
But if the query finds no data and the built string is empty, I have a problem. I still see some options in the pull down list. They seem to be values that had previously been selected. I am trying to locate these ghost values.
Chrome Dev Tools shows me that the children of the datalist object has length=0
. So where are the values being displayed coming from? How do I clear them?