Sample Qbank Programming With JavaScript - 0
Sample Qbank Programming With JavaScript - 0
A \f C \b
B \o D \t
A Twice C Once
B Thrice D Not at all
A Booleans C Strings
B Functions D Objects
A Traceur C CoffeeScript
B Duck-typing D Compilers
Match the online tools available for minifying JavaScript code with their features.
element.setAttribute(attrib
A document.getElementById C
ute, value)
B JSON.parse() D getElementsByTagName
<!DOCTYPE html>
<html>
<!DOCTYPE html>
<body>
<html>
<p>Hello Script!</p>
<body>
<p class="intro">The DOM is
<p id="intro">Hello Script!</p>
very useful.</p>
<p>This example demonstrates the
<p class="intro">This example
<b>getElementsById</b>
demonstrates the
method.</p>
<b>getElementsByClassName</b>
<p id="demo"></p>
method.</p>
<script>
<p id="demo"></p>
var myElement =
A document.getElementById("intro") C <script>
var x =
;
document.getElementsByClassName
document.getElementById("demo").
("intro");
innerHTML =
document.getElementById("demo")
"The text from the intro
.innerHTML =
paragraph is " +
'The first paragraph (index 0)
myElement.innerHTML;
with class="intro": ' +
</script>
x[0].innerHTML;
</body>
</script>
</html>
</body>
</html>
<!DOCTYPE html>
<!DOCTYPE html>
<html>
<html>
<body>
<body>
<p>Hello Script!</p>
<p>Hello Script!</p>
<p class="intro">This example
<p>This example demonstrates the
demonstrates the
<b>getElementsByTagName</b>
<b>querySelectorAll</b>
method.</p>
method.</p>
<p id="demo"></p>
<p id="demo"></p>
<script>
<script>
var x =
B document.getElementsByTagName("p D var x =
document.querySelectorAll("p.in
");
tro");
document.getElementById("demo").
document.getElementById("demo")
innerHTML =
.innerHTML = 'The first
'The text in first paragraph
paragraph (index 0) with
(index 0) is: ' +
class="intro": ' +
x[0].innerHTML;
x[0].innerHTML;
</script>
</script>
</body>
</body>
</html>
</html>