admin管理员组文章数量:1244432
If I want to get field data by ID I will user: var contentText = $("#contentText").val();
How do I get field data by field name?
i.e.: <textarea name="contentText"></textarea>
If I want to get field data by ID I will user: var contentText = $("#contentText").val();
How do I get field data by field name?
i.e.: <textarea name="contentText"></textarea>
- 1 possible duplicate of How to get the value of a selected radio button using its name in jQuery? – Tomasz Kowalczyk Commented Apr 16, 2014 at 19:00
1 Answer
Reset to default 15You can do that with attribute selector:
$("textarea[name='contentText']")
You can read more about it here: https://api.jquery./attribute-equals-selector/
本文标签: javascriptGet textarea by name attributeStack Overflow
版权声明:本文标题:javascript - Get textarea by name attribute - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1740161254a2234472.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论