我是 jquery 新手,在从页面上获取值时遇到问题。
这是我的 HTML:
<tr>
<td>ID:</td>
<td>4166</td>
我想得到值 = 4166
这是我的jQuery代码:
$("td").filter(function() {
var woid;
return $(this).text() === "ID:";
woid = $(this).nextALL.text();
return alert(woid);
});
但它不起作用。
谢谢您的帮助。
PS - 这是一个 jsfiddle = jsfiddle