Click anywhere in this pane, then try tabbing through the elements.
<p>Click anywhere in this pane, then try tabbing through the elements.</p> <ch5-toggle id="demo" label="Retina" labelOn="On" labelOff="Off" > </ch5-toggle> <br><br> <ch5-toggle id="demo2" label="Microphone" labelOn="On" labelOff="Off" > </ch5-toggle>
var elem = document.getElementById("demo"); var elem2 = document.getElementById("demo2"); elem.addEventListener('focus', function(e){ console.log('ch5-toggle focus event: ', e.target.attributes.label.nodeValue); }); elem.addEventListener('blur', function(e){ console.log('ch5-toggle blur event: ', e.target.attributes.label.nodeValue); }); elem2.addEventListener('focus', function(e){ console.log('ch5-toggle focus event: ', e.target.attributes.label.nodeValue); }); elem2.addEventListener('blur', function(e){ console.log('ch5-toggle blur event: ', e.target.attributes.label.nodeValue); });