The following code shows the head and body sections in an HTML file:
<head>
<script>
function init() {
var x, y, z;
z = document.getElementById("abc").innerHTML;
y = "B";
x = "C";
document.getElementById("abc").innerHTML = x+y+z;
}
</script>
</head>
<body onload="init();">
<p id="abc">A</p>
</body>
What would be displayed on the browser when the above webpage is opened?
BC
CB
or
CBA
or
A
or
ABC
Output would be displayed on the browser when the above webpage is opened is CBA So, answer is CBA
CBA
Get Answers For Free
Most questions answered within 1 hours.