3 ms·
Does anyone have a good list of vanilla approaches? I'm a fan of details/summary, but I'm sure there are more I don't know.
by 8organicbits 3y ago
Does anyone have a good list of vanilla approaches? I'm a fan of details/summary, but I'm sure there are more I don't know.
- oceanstone 3y agoThese vanilla JavaScript features are pretty great IMO - https://developer.mozilla.org/en-US/docs/Web/API/Document/querySelector https://developer.mozilla.org/en-US/docs/Web/API/Document/qu... - https://developer.mozilla.org/en-US/docs/Web/API/Document/querySelectorAll https://developer.mozilla.org/en-US/docs/Web/API/Document/qu... - https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe... - https://developer.mozilla.org/en-US/docs/Web/API/Element/insertAdjacentHTML https://developer.mozilla.org/en-US/docs/Web/API/Element/ins... - https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener https://developer.mozilla.org/en-US/docs/Web/API/EventTarget... - https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API
- calvinmorrison 3y agoTbf they got better. Jquery basically existed because the js builtins were hairy
- HerrBertling 3y agoI like datalist quite a bit for „poor man‘s autocomplete“ - you can dynamically fill it via JS and will get the suggestions shown in the completion fields above the keyboard on mobile and… well, something (?) on desktop. Not as nice as an autocomplete, but with way less issues re accessibility etc. Edit: Forgot two things: - You can disable the `fieldset` attribute to disable all inputs within. So properly nest your forms and you‘ll have a simpler way of controlling forms. - Buttons can have a `value` attribute which works great to differentiate between various action paths for e.g. list items (delete, edit,…)