You need to convert your <
and >
characters in JavaScript to HTML entities < and > (less than and greater than).
For instance, the Javascript code is:
<p id="demo"></p>
<script>
document.getElementById("demo").innerHTML =
obj.employees[1].firstName + " " + obj.employees[1].lastName;
</script>
<script>
document.getElementById("demo").innerHTML =
obj.employees[1].firstName + " " + obj.employees[1].lastName;
</script>
You need to convert the <
and >
characters in JavaScript to HTML entities < and >:
<p id="demo">
</p>
<br />
<script>
document.getElementById("demo").innerHTML =
obj.employees[1].firstName + " " + obj.employees[1].lastName;<br />
</script>