Skip to content

Latest commit

 

History

History
17 lines (12 loc) · 439 Bytes

README.md

File metadata and controls

17 lines (12 loc) · 439 Bytes

Select To Datalist

Convert a <select> element into an <input> with a <datalist>. This is for progressive enhancement if the HTML <datalist> element is supported.

Add select-to-datalist.js to html

<script src="path/to/select-to-datalist.js"></script>

Then convert the relevant element with selectToDatalist

var selectElement = document.getElementById("id");
selectToDatalist(selectElement);