javascript - Function not working after running it 1 time -
here's fiddle of i'm doing
essentially, want inline-edit items, , save them via ajax.. added function called select(name)
creates select element , adds name + id later gets populated options(name, value, selectelement)
function. htlm should replaced when click edit.
it works fine when attempt use select()
1 time. when try apply other fields, however, gives me:
typeerror: select not function days = select("day");
i've read other questions thoroughly (maybe missed one), don't think have bad syntax, unclosed html or js, or overwriting function.
any ideas? ahead of time
code:
// create select field select = function(name) { s = "<select></select>"; select = $(s).attr("name", name).attr("id", name); return select; } // add options select options = function(name, value, selectelement) { o = "<option></option>"; option = $(o).attr("value", value).html(name); s = $(selectelement).append(option); return s; }
Comments
Post a Comment