1 <!DOCTYPE HTML> 2 <html> 3 <head> 4 </head> 5 <body> 6 <div id="test">Click/tap me</div> 7 <script> 8 var el = document.getElementById('test'); 9 var valueSettableByTest = 0; 10 var valueToTest = 0; 11 el.addEventListener('click', function() { 12 valueToTest = valueSettableByTest; 13 }); 14 </script> 15 </body> 16 </html> 17