adds onupdate event handler for input and textarea

Close #310