我有與定義如下文本字段的形式:jQuery的,獲得ID一個textarea
<textarea style="height: 60px; width: 100%;" name="F3414" id="F3414" rows="6" cols="80" wrap="virtual" class="frmTxa fckEditor"></textarea>
我需要,使用jQuery,得到textarea的id
(在這種情況下,F3414
)。
我已經試過:
$('textarea .fckEditor').attr('id');
$('.fckEditor').attr('id');/... with no luck.
任何想法?
非常感謝
$('textarea.fckEditor')。attr('id');/$('textarea.frmTxa')。attr('id');/$('textarea.frmTxa')。attr('id');/$('。frmTxa .fckEditor')。attr('id');/$('。frmTxa.fckEditor')。attr('id');所有返回的undefined :-( – Olivier 2011-04-12 09:53:23
非常感謝這個工作示例,假設我的應用程序「怪異」,並且它們加載表單的方式並不理想。在Firebug中使用控制檯沒有幫助...添加jQuery代碼在我的表單中工作就像一個魅力... $('textarea.fckEditor')。attr('id') – Olivier 2011-04-12 10:18:38