Added unit tests and oninput event