Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
<form name="myForm"> <input type="text" name="f['cart']]['product_name']"/> </form>
如何使用 javascript 访问文本字段的值?
从表单集合中获取表单,然后从所述表单的元素集合中获取输入。
document.forms['myForm'].elements["f['cart']]['product_name']"]