sudhakarinfotech
(current)
Run Code
Live Code Editor- Javascript Object Using JSON Literal
Source Code
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Creating An Object From The JSON Literal</title> </head> <body> <h1>Creating An Object From The JSON Literal</h1> <p id="result"></p> <script> var users = { "name": "Smith", "salary": 45000 }; document.getElementById("result").innerHTML = users.name; </script> </body> </html>
Source Code Output :
Running