如何使用JavaScript/jQuery获取表单数据?
<form> <input type="radio" name="foo" value="1" checked="checked" /> <input type="radio" name="foo" value="0" /> <input name="bar" value="xxx" /> <select name="this"> <option value="hi" selected="selected">Hi</option> <option value="ho">Ho</option></form>
{ "foo": "1", "bar": "xxx", "this": "hi"}
$("#form input").each(function() { data[theFieldName] = theFieldValue;});
万千封印
蝴蝶不菲
相关分类