0% found this document useful (0 votes)
2 views

Grade8 JavaScript

Uploaded by

nisha.kawale
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Grade8 JavaScript

Uploaded by

nisha.kawale
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Ch.

5 JavaScript in HTML
Ans- 1. Document.getElementById()

2. document.getElementByClassName()

Ans- 1. Onclick event, 2.onmouseover event

Ans- JavaScripts are popularly used for creating interactive and Dynamic web pages and web
applications.

It is specially designed to integrate and communicate with other programming languages.

Ans- JavaScript and jQuery.

Ans-

Ans-External JavaScripts allow users to organize the scripts properly, reuse the script we created and
maintain it more easily.

Ans-
Ans- Karan should use the getElementById() or getElementsByClassName() DOM methods to
highlight specific items in a different colour.

Karan can select specific item from the list by getElement ById or ByName easily.

Ans-
<html>
<head>
<title>
Area of Rectangle</title>
<body>
<script>
Function AreaOfRectangle(length,bredth)
{
var result=2*length*bredth;
alert(“area of a rectangle is:”+result);
}
Var input1=prompt(“enter length of a rectangle:”);
Var input2=prompt(“enter the bredth of a rectangle:”);
Var length=parseInt(input1);
Var bredth=parseInt(input2);
AreaOfRectangle(length,bredth);
</script>
</body>
</html>

You might also like