Move onchange event to buffered JS