-1
按鈕點擊不同的單元格的屬性值,在同一行中,我有一個按鈕和一個img 我要的是得到SRC圖像的屬性當我點擊按鈕時。 我可以得到整個數據。但無法弄清楚如何單獨獲取src。如何讓一個<strong>數據表</strong>在數據表
$('#exemptionsTable tbody').on('click', 'button', function() {
var data = exemptionsTable.row($(this).parents('tr')).data();
var img = data[11]; // result = <img width="100" height="50" class="PhotoId" src="/ExemptionImages/bf3f2111-f7c5-4208-896f-5e71b96bb66d.png">
});
如何從img對象獲取src屬性值?
中的DOMParser奏效了。謝謝。 我不能使用你的第二個建議,因爲它不會得到所需'行'的屬性值 – Osama