javascript add function to onchange event

JavaScript
transport_select.setAttribute("onchange", function(){toggleSelect(transport_select_id);});
// or
transport_select.onchange = function(){toggleSelect(transport_select_id);};
Source

Also in JavaScript: