Skip to content

Commit

Permalink
minor
Browse files Browse the repository at this point in the history
  • Loading branch information
PeijieXu committed May 27, 2022
1 parent 6f9e13d commit eb1ae2d
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions 01-Fundamentals-Part-1/starter/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,25 @@
<body>
<h1>JavaScript Fundamentals – Part 1</h1>
<script src="script.js"></script>

<p id="firstP"></p>
<p id="secondP"></p>

<script>
const text = `{"name":"xpj","age":"15"}`;
let obj = JSON.parse(text);
document.getElementById("firstP").innerHTML = obj.name;

obj.age = function () {
return 30;
}
const text2 = JSON.stringify(obj);


document.getElementById("secondP").innerHTML = text2;
// document.createElement("p").innerHTML = JSON.stringify(obj);

</script>
</body>

</html>

0 comments on commit eb1ae2d

Please sign in to comment.