我有一個HTML表,隨後以簡單的形式,它接受象下面選擇行和使用jquery和更新其內容
<table border="1" style="width:100%">
<tr>
<td>Row 1 Col1</td>
<td>Row 1 Col2</td>
<td>Row 1 Col3</td>
<td>Row 1 Col4</td>
<td>Row 1 Col5</td>
<td>Row 1 Col6</td>
</tr>
<tr>
<td>Row 2 Col1</td>
<td>Row 2 Col2</td>
<td>Row 2 Col3</td>
<td>Row 2 Col4</td>
<td>Row 2 Col5</td>
<td>Row 2 Col6</td>
</tr>
<tr>
<td>Row 3 Col1</td>
<td>Row 3 Col2</td>
<td>Row 3 Col3</td>
<td>Row 3 Col4</td>
<td>Row 3 Col5</td>
<td>Row 3 Col6</td>
</tr>
</table>
<form>
<input type="text" placeholder="Row" value="row"/>
<input type="text" placeholder="Column" value="column"/>
<button id="submitButton" type="submit"> Submit </button>
</form>
表的行和列可以改變,並且可以將表的行和列的表中的colums有n個行和列。我想要做的是基於用戶輸入(選擇行和列並提交)我想更新用戶選擇的行和列的內容來說「你好」。如果用戶選擇一列,則不可用的行組合會提示錯誤消息。我怎麼能在jQuery中做到這一點。
在此先感謝。