<form>
<input name="username" type="text"/>
<input name="password" type="password"/>
<input id="submitButton" type="button" value="submit">
</form>
$("#submitButton").click(function(){
var data = {};
var t = $(\'form\').serializeArray();
$.each(t, function() {
data [this.name] = this.value;
});
alert(JSON.stringify(data));
});
相关文章:
- PHP中获取表单数据中的数据 2021-09-11
- jquery的ajax获取form表单数据、提交表单form 2021-12-31
- html基础:jquery的ajax获取form表单数据 2021-10-03
- jquery 获取 表单值 2021-11-29
- jquery获取表单值 2021-11-29
- jquery表单提交获取数据(带toast dialog) 2021-11-28
- Django从表单中获取数据 2022-01-01