Kitsada Posted April 15, 2023 Share Posted April 15, 2023 I want to use datalist in html, I tried it and it doesn't work. image >> aatQKl.png (716×484) (img.in.th) <label for="reigster">Log in</label> <input type="text" class="input" placeholder="Username" id="user" list="username-list"> <datalist id="username-list"> <option value="John"> <option value="Doe"> <option value="Jane"> </datalist> <input type="text" class="input" placeholder="Password" id="pass"> <div class="btn-go btn-login">Log in</div> 1 minute ago, Kitsada said: I want to use datalist in html, I tried it and it doesn't work. image >> aatQKl.png (716×484) (img.in.th) <label for="reigster">Log in</label> <input type="text" class="input" placeholder="Username" id="user" list="username-list"> <datalist id="username-list"> <option value="John"> <option value="Doe"> <option value="Jane"> </datalist> <input type="text" class="input" placeholder="Password" id="pass"> <div class="btn-go btn-login">Log in</div> Link to comment
FLUSHBICEPS Posted April 15, 2023 Share Posted April 15, 2023 u should close ur "<options>" tags afaik Link to comment
Moderators IIYAMA Posted April 16, 2023 Moderators Share Posted April 16, 2023 On 15/04/2023 at 16:17, Kitsada said: I want to use datalist in html, I tried it and it doesn't work. I tested your code and it works fine. But keep in mind that in your current setup it is used as an auto complete feature. Typing `Jo` makes auto complete John available. Also when you press your arrow-down key, it should act more as the options tag as @FLUSHBICEPS referring to. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now