我有两个包含客户信息的下拉列表。 使用PHP for循环,我允许一次输入5个客户的详细信息。使用jQuery从php循环中选择元素的ID
for($i=1; $i<6; $i++)
{
echo "<tr><td><select id=\"customer_" . $i . "_class\"></select></td>";
echo "<td><select id=\"customer_" . $i . "_age\"></select></td></tr>";
}
现在我想以这样的方式来执行一个jQuery函数,如果,例如,customer_2_class变化,它执行了一些功能到其相应的customer_2_age。
$("#customer_?_clas").change(function()
{
//some function to execute on corresponding customer_?_age
});
什么是你的问题? – Jared