Javascript examples for jQuery:Json
Mapping JSON properties to HTML ID to Easily Set Values
<html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script> </head> <body> <input id="name"> <input id="addressOne"> <script> var address = {id: 100, name: "Gregg", addressOne: "111 1st Street"}; $('input').each(function(){ $(this).val(address[this.id]); });//from w w w. j a va 2s . c o m </script> </body> </html>