javascript - JS - construct an event -


i'm reading code example , i'm wondering last line means:

function simulateclick() {  var event = new mouseevent('click', { 'view': window, 'bubbles': true, 'cancelable': true  });   var cb = document.getelementbyid('checkbox');   var canceled = !cb.dispatchevent(event); 

it means canceled assigned false if cb.dispatchevent(event) returns truthy (i.e. false, 0, '', null, undefined or nan) , vice-versa.


Comments

Popular posts from this blog

html - Sizing a high-res image (~8MB) to display entirely in a small div (circular, diameter 100px) -

java - IntelliJ - No such instance method -

identifier - Is it possible for an html5 document to have two ids? -