What is the purpose of using javascript in web designing? Can anyone pls tell me?


JavaScript is a scripting or programming language that allows you to implement complex features on web pages.

Reference: What is JavaScript

To your question: “what is the purpose of using javascript in webdesigning?”

In basic terms it allows the end_user to interact with your website. Another way to look at it’s purpose is JavaScript allows the website to become dynamic instead of static.

Some examples would be:

  • Creating a slide show with images
  • Creating a form that sends information to a database
  • Creating a change to the style of your CSS
  • Creating a change to the content within the HTML page.

Code Example:
If you want to create a button to change the color of some text you could write:

<!DOCTYPE html>

<h2>Change My Color To Blue</h2>

<p id="changeColor">Watch Me Change Color when you click the button.</p>

<button type="button" onclick="document.getElementById('changeColor').style.color='blue'">Click Me!</button>

</html> ```