javascript - Uncaught TypeError: elements[i].attr is not a function -
this code:
function () { var container = document.getelementbyid('data-table'); var elements = container.getelementsbytagname("input"); (i = 0; < elements.length; i++) { elements[i].on("ifchanged", handle_company_state(elements[i].attr('id'))); } } function handle_company_state(element_id) { //.... }
when i'm trying run i' getting error:
uncaught typeerror: elements[i].attr not function
why?
i think looking like:
function () { var elements = $("#data-table input"); (i = 0; < elements.length; i++) { $(elements[i]).on("ifchanged", handle_company_state($(elements[i]).attr('id'))); } } function handle_company_state(element_id) { //.... }
Comments
Post a Comment