Real time HTML tester
Try rewriting your script with an addEventListener instead of an onChange method.

However, keep in mind that an addEventListener is not compatible with IE lower then IE9. So don't use this yet in live sites.


https://developer.mozilla.org/en-US/docs/Web/API/EventTarget.addEventListener?redirectlocale=en-US&amp;redirectslug=DOM%2FEventTarget.addEventListener
http://coding.smashingmagazine.com/2013/11/12/an-introduction-to-dom-events/