What is JavaScript (how create javascript page )
what-is-javascript-how-create-javascript-page

What is JavaScript (how create javascript page )

What is JavaScript

javaScript (JS) is a lightweight, interpreted, or just-in-time compiled programming language with first-class functions. While it is most well-known as the scripting language for Web pages, many non-browser environments also use it, such as Node.js, Apache CouchDB and Adobe Acrobat. JavaScript is a prototype-based, multi-paradigm, single-threaded, dynamic language, supporting object-oriented, imperative, and declarative (e.g. functional programming) styles.

JavaScript Code

<!DOCTYPE html>
<html>
<body>

<h2>What JavaScript ?</h2>

<p id=”demo”>JavaScript can change HTML content.</p>

<button type=”button” onclick=’document.getElementById(“demo”)

.innerHTML = “Hello JavaScript!”‘>Click Me!</button>

</body>
</html>

       preview

What JavaScript ?

JavaScript can change HTML content.

JavaScript first steps

Answers some fundamental questions such as “what is JavaScript?”, “what does it look like?”, and “what can it do?”, along with discussing key JavaScript features such as variables, strings, numbers, and arrays.
JavaScript building blocks
Continues our coverage of JavaScript’s key fundamental features, turning our attention to commonly-encountered types of code blocks such as conditional statements, loops, functions, and events.

Introducing JavaScript objects

The object-oriented nature of JavaScript is important to understand if you want to go further with your knowledge of the language and write more efficient code, therefore we’ve provided this module to help you.

Asynchronous JavaScript

Discusses asynchronous JavaScript, why it is important, and how it can be used to effectively handle potential blocking operations such as fetching resources from a server.

Client-side web APIs

Explores what APIs are, and how to use some of the most common APIs you’ll come across often in your development work.

How to use javascript to create a light bulb

<!DOCTYPE html>
<html>
<body>

<h2>How to use javascript to create a light bulb?</h2>

<p>JavaScript can change HTML attribute values.</p>

<p>In this case JavaScript changes the value of the src

(source) attribute of an image.</p>

<button onclick=”document.getElementById(‘myImage’)

.src=’pic_bulbon.gif'”>Turn on the light</button>

<img id=”myImage” src=”pic_bulboff.gif” style=”width:100px”>

<button onclick=”document.getElementById(‘myImage’)

.src=’pic_bulboff.gif'”>Turn off the light</button>

</body>
</html>

 

      preview

How to use javascript to create a light bulb?

JavaScript can change HTML attribute values.

In this case JavaScript changes the value of the src (source) attribute of an image.

  

JavaScript is one of the 3 languages all web developers must learn:

1. HTML to define the content of web pages

2. CSS to specify the layout of web pages

3. JavaScript to program the behavior of web pages

Web pages are not the only place where JavaScript is used. Many desktop and server programs use JavaScript. Node.js is the best known. Some databases, like MongoDB and CouchDB, also use JavaScript as their programming language.

Note:- Hello friend if you have problem question please sand 

Leave a Reply