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
Post a Comment