Converted from "onchange"  to addEventListener