Can't Use Materialize-select? December 27, 2023 Post a Comment i try to use materialize-select,and it does't work? Choose your optionSolution 1: Try the followingdocument.addEventListener('DOMContentLoaded', function() { var elems = document.querySelectorAll('select'); var instances = M.FormSelect.init(elems,{}); });Copy<!DOCTYPE html><html><head><!--Import Google Icon Font--><linkhref="https://fonts.googleapis.com/icon?family=Material+Icons"rel="stylesheet"><!--Import materialize.css--><linktype="text/css"rel="stylesheet"href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/css/materialize.min.css"media="screen,projection"/><!--Let browser know website is optimized for mobile--><metaname="viewport"content="width=device-width, initial-scale=1.0"/></head><body><divclass="input-field col s12"><select><optionvalue=""disabledselected>Choose your option</option><optionvalue="1">Option 1</option><optionvalue="2">Option 2</option><optionvalue="3">Option 3</option></select><label>Materialize Select</label></div><!--JavaScript at end of body for optimized loading--><scripttype="text/javascript"src="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/js/materialize.min.js"></script></body></html>Copy Share Post a Comment for "Can't Use Materialize-select?"
Post a Comment for "Can't Use Materialize-select?"