Skip to content

Instantly share code, notes, and snippets.

@killinterpol
Created March 25, 2014 06:14
Show Gist options
  • Select an option

  • Save killinterpol/9756090 to your computer and use it in GitHub Desktop.

Select an option

Save killinterpol/9756090 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery-1.11.0.min.js"></script>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
<input type="text" id="id"/>
<input type="text" id="name"/>
<input type="text" id="desc"/>
</body>
</html>
var data = { "id" : "123", "name" : "ObjectName", "desc" : "description"};
$(document).ready( function() {
$.map(data, function (prop, i) {
console.log(i);
$("#"+i).val(prop);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment