如何在jQuery中使用类名检索ID标记的值。使用jQuery从类获取ID的价值?
我在尝试下面的代码,但它返回值undefined
。
<html>
<body>
<textarea id='5' class='cp _check'>sometexthere</textarea>
</body>
<html>
,并使用以下函数调用它:
function updatecontent() {
var check = $('.cp _check').('#id').val();
alert(check);
}
的alert
箱返回值undefined
。
- 谢谢...这工作...真的很感激迅速的回应。非常感谢 – user2131970 2013-03-17 11:52:53