WorksheetsHTML CSS JS
Total questions: 20
Worksheet time: 10mins
Which of the below options is correct to change the background color to blue in CSS?
body {
background-colour: lightblue;
}
body {
background-color: lightblue;
}
body {
background:color: lightblue;
}
None of the above
Predict the output for the piece of code:
<html>
<body>
<script language="JavaScript">
function Test(){
document.write("Hello World!");
}
</script>
<input type="submit" value="click here" onclick="Test()"/>
</body>
</html>
Error
Displays Hello World! Along with clickhere button
Displays Hello World! after clicking on clickhere button
Displays nothing
Predict the output:
<p id="test"></p>
<script>
var date = 10;
month = "July";
var year = 2020;
document.getElementById("test").innerHTML =
date + "<br>" + month + "<br>" + year
</script>
No output
44022
10
July
2020
10
2020
Predict the output:
<!DOCTYPE html>
<html>
<body>
<p id="test"></p>
<script>
function firstFunction(p1, p2) {
return p1 + p2;
}
document.getElementById("test").innerHTML = firstFunction(1, 5);
</script>
</body>
</html>
6
No output
Error while declaring the function
None of the above
