Javascript examples for DOM:Event
Init event with event.initEvent
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> window.onload=( function() {//from w w w. j a v a2 s .c o m el = document.getElementById('x'); el.value = 'pancakes'; ev = document.createEvent('Event'); ev.initEvent('change', true, false); el.dispatchEvent(ev); }); </script> </head> <body> <input type="text" id="x" onchange="console.log('Changed!')"> </body> </html>