var name = $('input[name="name"]').val();
var email = $('input[name="email"]').val();
var password = $('input[name="password"]').val();
var gender = $(':radio:checked').parent().text();
var city = $(':input[name="city"] option:checked').val()
json = JSON.stringify({"name":name, "email":email, "password":password, "gender":gender, "city":city});
[JQuery] 表单选择器 - 廖雪峰课程作业
最新推荐文章于 2022-02-09 13:17:33 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)