javascript - Defining a click event programmatically -
i creating dynamic anchor tag this
var anch = $('<a />', { 'href': '#' + ctrlid, 'text': text })
how add click event while creating tag automatically calls function funcone(ctrlid) , passes ctrlid?
i tried no luck
var anch = $('<a />', { 'href': '#' + ctrlid, 'text': text, 'onclick': funcone(ctrlid) })
var anch = $('<a />', { 'href': '#' + text, 'text': text, on: { click: function () { // }, someotherevent: function () { // } } });
Comments
Post a Comment