Attach event using Javascript -


i'd attach event when function called, seems not working using addeventlistener...

my code :

function add () {   this.inputstring.input.addeventlistener('mouseover', toggle.call(this)); }  function toggle () {   $(this.tooltip).toggle(); } 

issue : toggle() function doesn't work. however, this.inputstring.input , this.tooltip not emtpy...

the apparent problem see here should attach function addeventlistener's second argument, not call itself:

this.inputstring.input.addeventlistener('mouseover', toggle); 

then should consider reviewing toggle() function itself.
mean this.tooltip ?

but out of scope of question (about attaching events).


Comments

Popular posts from this blog

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12:test (default-test) on project.Error occurred in starting fork -

windows - Debug iNetMgr.exe unhandle exception System.Management.Automation.CmdletInvocationException -

configurationsection - activeMq-5.13.3 setup configurations for wildfly 10.0.0 -