xcislav Posted April 16, 2014 Share Posted April 16, 2014 (edited) Cut the code: <input onkeyup="s?e=Date.now():s=Date.now()"onblur="c=this.value.length;this.value+=c/(e-s)"><script>s=0</script> ☑ 113 <input onkeyup="s?e=Date.now():s=Date.now()"onblur="c=this.value.length;this.value+=c/(e-s)"> Ø 93 Edited April 17, 2014 by xcislav 1 Link to comment Share on other sites More sharing options...
thescientist Posted April 16, 2014 Share Posted April 16, 2014 neither of those approaches looks appealing in the least. Event handling / listening is recommended instead. https://developer.mozilla.org/en-US/docs/Web/API/EventTarget.addEventListener Link to comment Share on other sites More sharing options...
davej Posted April 16, 2014 Share Posted April 16, 2014 Yes, as Scientist says, wouldn't it be much nicer and cleaner to have unified handlers for these inputs? Why would you want all of that embedded code in the HTML? On pageload you would have a loop assign all of the input elements to the same handler functions which would then collect the clickstream data. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now