Wednesday, 3 June 2020

UGC NET Computer Science December 2019 | Question 66

Question 66
Which tag is used to enclose any number of javascript statements in HTML document?
  1. 1. <code>
  2. 2. <script>
  3. 3. <title>
  4. 4. <body>
Explanation
The < script > tag is used to define a client-side script (JavaScript).

The < script > element either contains scripting statements, or it points to an external script file through the src attribute.

Common uses for JavaScript are image manipulation, form validation, and dynamic changes of content.

Rest options are part of a normal HTML document.

So, option 2 is correct answer

Look at below example java script function for more detail: this function changes the html element text, style text color and fontSize. This function encloses 3 statements.

<!DOCTYPE html>
<html>
<head>
<script>
function myFunction() {
document.getElementById("demo").innerHTML = "Hello World!";
document.getElementById("demo").style.color = "blue";
document.getElementById("demo").style.fontSize = "35px";
}
</script>

</head>
<body>
<p>When you click "Try it", a function will be called.</p>
<p>The function will display a message.</p>
<button onclick="myFunction()">Try it</button>
<p id="demo"></p>
</body>
</html>


Reference : JavaScript Introduction

PreviousNext
UGC NET CS December 2019 - Question 65UGC NET CS December 2019 - Question 67

No comments:

Post a Comment

UGC NET Computer Science December 2019 | Question 16

Question 16 In a certain coding language. 'AEIOU' is written as 'TNHDZ'. Using the same coding language. 'BFJPV' wil...

Popular Posts