0
我正在動態創建表格行。在每一行中,我也在創建按鈕。表示每行都有按鈕。單擊按鈕我想通過value屬性的值(值=「 '+ patient.appointmentId +')在功能getAppointment()。在調用onclick()函數的函數中傳遞按鈕值屬性值,動態創建按鈕
<button type="button"
value="'+patient.appointmentId+' "id="cancel-appointment"
onclick = "getAppointment()" class="fa fa-remove btn-transparent">
</button>
想這
<button type="button"
value="'+patient.appointmentId+' "id="cancel-appointment"
onclick = "getAppointment(patient.appointmentId)" class="fa fa-remove btn-transparent">
</button>