gpt4 book ai didi

javascript - 单击按钮后如何编辑特定 td 中的值

转载 作者:行者123 更新时间:2023-11-28 06:54:19 25 4
gpt4 key购买 nike

这是我的按钮

<button id="Modify" role="button" class="btn btn-warning" disabled>Modify</button>

这是我的修改按钮的脚本

$("#Modify").click(function(e) {
e.preventDefault();
var id = $('#cLoanOut2 tr.active').attr('id');
bootbox.confirm("Are you sure you want to modify this order?","No","Yes",function(r){
if(r) {
$.ajax({
url : "<?php echo $server_name; ?>/emcis_coopmain/process/PHP_groceryReleasingProcess.php",
type : "POST",
async : false,
data : {
empgrocmstID:id,
todo:"Modify"
},
success:function(result){
bootbox.alert('Order Modified',function(){
$("#Modify").attr("disabled", true);
});
loadTable();
}
});
} else {

}
});
});

还有我的php中的td

$html .= "<td class='qty_ordered' style='text-align:right'>$qty_ordered</td>";

点击修改按钮后如何编辑该 td 上的值?

感谢您的帮助

最佳答案

如果该类是特定的 <td>那么就简单了

$("td.qty_ordered").html("<Your new value here>");

此外,如果我的假设是正确的,您可以更改 td您的值 success()在您的 ajax() 中运行打电话。

马布海!

关于javascript - 单击按钮后如何编辑特定 td 中的值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32688063/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com