xcislav 1 Posted April 16, 2014 Report 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 Quote Link to post Share on other sites
thescientist 231 Posted April 16, 2014 Report 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 Quote Link to post Share on other sites
davej 251 Posted April 16, 2014 Report 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. Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.