Input:
json = {}; json.name=$('input[name=name]')[0].value; json.email=$('input[name=email]')[0].value; json.password=$('input[name=password]')[0].value; json.gender=$('input[name=gender]')[0].checked?'m':'f'; json.city=$('select[name=city]')[0].value; json=JSON.stringify(json,null,' ');
Output:
{ "name": "123", "email": "123@123.com", "password": "123", "gender": "f", "city": "XM" }
Sign in to make a reply
FranzWH
Input:
Output: