【发布时间】:2018-12-20 10:09:28
【问题描述】:
我有下表以及根据其具有的文本制作表格单元格<td> 可点击/超链接的最佳方法。
<table id="fresh-table" class="table">
<thead>
<th data-field="id" data-sortable="true">ID</th>
<th data-field="URL" data-sortable="true">URL</th>
<th data-field="Results">Results</th>
</thead>
<tbody>
<tr>
<td>1</td>
<td><a href="#">https://google.com</td>
<td>Woot</td>
</tr>
<tr>
<td>1</td>
<td><a href="#">https://facebook.com</td>
<td>Hax</td>
</tr>
</tbody>
</table>
$(document).ready(function(){
var x = $('.clickme').getText();
console.log(x);
});
我想根据它得到的文本替换 href 的值:
https://google.com 或 https://facebook.com。
【问题讨论】:
标签: javascript jquery jquery-plugins