0% found this document useful (0 votes)
38 views7 pages

Javascript

JavaScript, created in 1995, is a high-level interpreted language primarily used for client-side interactivity in web browsers. It enables dynamic web pages through features like DOM manipulation and client-side execution, which enhances speed and reduces server load. The document also covers the placement of JavaScript code, keywords, and a demo showcasing how to update content dynamically using JavaScript.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
38 views7 pages

Javascript

JavaScript, created in 1995, is a high-level interpreted language primarily used for client-side interactivity in web browsers. It enables dynamic web pages through features like DOM manipulation and client-side execution, which enhances speed and reduces server load. The document also covers the placement of JavaScript code, keywords, and a demo showcasing how to update content dynamically using JavaScript.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd

UMME NAFISA ANZUM KOTHA

ID-2154901047
JavaScript, created in 1995 and renamed from LiveScript.

high-level interpreted language

mainly used in web browsers for client-side interactivity

why to use JavaScript-


Interactivity – JavaScript makes web pages dynamic (e.g., buttons, forms, animations)

DOM Manipulation – Allows real-time updates to HTML/CSS without reloading the page.

Client-Side Execution – Runs in the browser, reducing server load and


improving speed.
PlACEMENT OF JAVASCRIPT CODE
EMBEDDED JAVASCRIPT EXTERNAL JAVASCRIPT
<html>
<head>
<script>
alert(“Good Morning!"); /[Link] /
</script> [Link](‘welcome to the class!’);
</head>
<body>
<h1>JavaScript in Body</h1>
<script> External scripts help keep code clean and
alert("Hello, JavaScript!"); reusable
</script>
<p>
<script src=“[Link]”></script>
</p>
</body>
</html>
JavaScript Keywords
Variables store data that can be reused or updated later.

The let keyword is block-scoped, allows reassignment, but cannot be redeclared


in the same scope.

The const keyword is block-scoped, cannot be reassigned or redeclared, and must be initialized
during declaration.
Primitive datatypes represent single values

Non-primitive types are objects and can store


collections of data or more complex entities.
JAVASCRIPT DEMO

<body>
<h1 id="info">Welcome!</h1>
<p id="para">Click the button to interact with JavaScript!</p>
<button id="click" onclick="updateContent()">Click Me</button>

<script src="[Link]"></script>
</body>
/Javascript code/
function updateContent() {
const header=[Link]('info’);
header. innerHTML = ‘<h2>🎉 Presentation Started!</h2>';

const para= [Link]('para’);


[Link] = 'JavaScript updated this text’;
[Link]("Button clicked using onclick attribute.");
}
THANK YOU!

You might also like