Professional Documents
Culture Documents
Roll no: 35
Batch: T2
ASSIGNMENT NO: 12
Problem Statement: Create simple objects and array objects using JSON.
PROGRAM:
<html>
<body>
<h2>Convert a JavaScript object into a JSON string, and send it to the server.</h2>
<p id ="out"></p>
<script>
var myObj = { name: "John", age: 31, city: "New York" };
document.getElementById("out").innerHTML = myObj.name;
</script>
</body>
</html>