a) Controlled loop constructs
b) Case checking constructs
c) Validation constructs
d) All of the mentioned
2. The main purpose of a “Live Wire” in NetScape is to ________
a) Create linkage between client side and server side
c) Support only non relational database
Explanation: A Live Wire database driver also supports a number of non-relational databases.
3. The script tag must be placed in __________
a) the head tag
b) the head or body
c) the title or head
d) after the body tag
Explanation: If the script tag is placed after the body tag, then, it will not be evaluated at all. Also, it is always recommended and effective to use the script snippet in the <head> tag.
a) will throw errors and exceptions
b) must be restricted to a Unix Machine only
c) will work perfectly well on a Windows Machine
a) make computations in HTML simpler
b) minimize storage requirements on the web server
c) increase the download time for the client
d) increase the loading time of the website
6. Which attribute is used to specify that the script is executed when the page has finished parsing? (only for external scripts)
b) a sync
Explanation: The defer attribute is a Boolean attribute. When present, it specifies that the script is executed when the page has finished parsing.
b) Triggering Event
a) directly into JS file and included into HTML
b) directly on the server page
c) directly into HTML pages
d) directly into the css file
9. Which of the following Attribute is used to include External JS code inside your HTML Document?
10. A proper scripting language is a __________
a) High level programming language
b) Assembly level programming language
c) Machine level programming language
d) Low level programming language
<p id="demo"></p> var txt1 = "good"; var txt2 = "day"; document.getElementById("demo").innerHTML = txt1 + txt2;
a) good day
Explanation: The + operator acts as a concatenation operator when used with string. The new string does not have any space between the two added string.
<p id="demo"></p> <script> var x = 5; var y = 2; var z = x % y; document.getElementById("demo").innerHTML = z; </script>
Explanation: The % operator returns the remainder between the two numbers. It is used many times with if condition to check whether the number is divisible or not.
<p id="demo"></p> <script> var x = 10; x *= 5; document.getElementById("demo").innerHTML = x; </script>
Explanation: The *= operator is a shorthand expression for multiplication of a particular number. It is a combination of two operators * and = .
<p id="demo"></p> <script> txt1 = “ one”; txt1 += “two”; document.getElementById("demo").innerHTML = txt1; </script>
b) one two
Explanation: The += operator acts in the same way as the concatenation operator in the string. There is no space added when two string are added together with += operator.
<p id="demo"></p> <script> document.getElementById("demo").innerHTML = typeof "John" </script>
Explanation: The typeof operator returns the type of the argument passed to it. The typeof operator returns number for an integer and string for a character array.