Skip to content
Advertisement

Tag: events

How to detect when a radio input is unchecked in Javascript

I have 4 radio input separated by divs. I want to select the input, and make the card border change. But the event listener only works when it’s checked, no when it’s unchecked. Codepen version https://codepen.io/nazarenoalt/pen/dyOKqYp HTML Answer You can maintain a reference to the last selected I would just add and remove a class so you do not have

Vue.js component parent event

im wondering why my code isn’t working. I have an event ‘leave’ which should be called on blur. The components are displayed properly but when i leave the inputs the event wont be triggered. Thanks for your help 🙂 Answer Your <text-input> component needs to forward (re-emit) the blur event from the inner <input> element: Then, <text-input>’s parent could receive

Reacting to selection changes in an HTML textarea

How can I get, for an HTML textarea element, called back on all selection changes to the text edited therein? (I am currently using the hack of combining keyup, keypress, and mousemove (for dragging selection endpoint), and maybe more could be added, but this is not exactly elegant.) I can’t find it in HTML documentation or on Stack Overflow. By ‘all

Advertisement