我有以下 jquery,它在调用函数时添加了一个文本框。在我使用提交按钮提交此文本框之前,我想在提交 onclick 中调用一个 javascript 函数,以确保在提交之前文本框不为空。我该怎么做我不确定如何使用该元素,因为它是动态添加的。
$("<center><div><input type = \'submit\' onclick=\'\' name = \'upload\' maxlength = 30/></div></center>").insertAfter("#"+innerid);
$("<center><div><input type = \'text\' id = \'newteam\' name = \'newteam\' maxlength = 30/></div></center>").insertAfter("#"+innerid);
任何想法我怎么能做到这一点?