Skip to content
geeksforgeeks
  • Courses
    • DSA to Development
    • Get IBM Certification
    • Newly Launched!
      • Master Django Framework
      • Become AWS Certified
    • For Working Professionals
      • Interview 101: DSA & System Design
      • Data Science Training Program
      • JAVA Backend Development (Live)
      • DevOps Engineering (LIVE)
      • Data Structures & Algorithms in Python
    • For Students
      • Placement Preparation Course
      • Data Science (Live)
      • Data Structure & Algorithm-Self Paced (C++/JAVA)
      • Master Competitive Programming (Live)
      • Full Stack Development with React & Node JS (Live)
    • Full Stack Development
    • Data Science Program
    • All Courses
  • Tutorials
    • Data Structures & Algorithms
    • ML & Data Science
    • Interview Corner
    • Programming Languages
    • Web Development
    • CS Subjects
    • DevOps And Linux
    • School Learning
  • Practice
    • Build your AI Agent
    • GfG 160
    • Problem of the Day
    • Practice Coding Problems
    • GfG SDE Sheet
  • Contests
    • Accenture Hackathon (Ending Soon!)
    • GfG Weekly [Rated Contest]
    • Job-A-Thon Hiring Challenge
    • All Contests and Events
  • HTML Tutorial
  • HTML Exercises
  • HTML Tags
  • HTML Attributes
  • Global Attributes
  • Event Attributes
  • HTML Interview Questions
  • HTML DOM
  • DOM Audio/Video
  • HTML 5
  • HTML Examples
  • Color Picker
  • A to Z Guide
  • HTML Formatter
Open In App
Next Article:
$ in JavaScript
Next article icon

HTML JavaScript

Last Updated : 18 Jan, 2024
Comments
Improve
Suggest changes
Like Article
Like
Report

HTML JavaScript is the most popular programming language that helps to add interactivity and provides dynamic behavior. It is known as the client-side scripting language for web pages. JavaScript is used for various purposes, including DOM manipulation, asynchronous requests (AJAX), event handling, fetching external API, and creating interactive web applications.

Additionally, After ES6 JavaScript becomes more popular and provides various functionalities for creating dynamic web pages.

Integrating JavaScript using HTML <script> Tag

The HTML <script> tag is used to integrate JavaScript code or give reference through the attribute "src" for external JavaScript files within an HTML document.

With the help of JavaScript, we can dynamically manipulate the HTML elements. Various HTML JavaScript operations can be done including, DOM manipulation, Adding or removing Style to the element, and adding or removing elements from the DOM.

Note: The most common operation done in JavaScript is finding the HTML elements.

Example: Illustration of the basic example of JavaScript that finds the element by tag name and styles the text with green.

HTML
<!DOCTYPE html> <html lang="en">  <head>     <meta charset="UTF-8">     <meta name="viewport" content="width=device-width,                                    initial-scale=1.0">     <title>HTML JavaScript</title> </head>  <body>     <h1>GeeksforGeeks</h1>     <h3>HTML JavaScript</h3>      <script>         const h1element = document                           .getElementsByTagName("h1")[0];         h1element.style.color = "green";     </script> </body>  </html> 

Output

HTML-JS

HTML <noscript> Tag

The HTML <noscript> tag is used to provide information displayed when a browser does not support or has disabled JavaScript in their browser.

Note: If the JavaScript is supported by your browser, the text inside the <noscript> tags will not rendered to the User Interface.

Example: Illustration of the basic example of HTML <noscript> tag.

HTML
<!DOCTYPE html> <html lang="en">  <head>     <meta charset="UTF-8">     <meta name="viewport" content="width=device-width,                                    initial-scale=1.0">     <title>HTML JavaScript</title> </head>  <body>     <h1 id="gfg">GeeksforGeeks</h1>     <h3>HTML JavaScript</h3>      <script>         const h1element = document             .getElementById("gfg");         h1element.style.color = "green";     </script>     <noscript>The browser you are using         doestnot support JavaScript.     </noscript>     <p>If the JavaScript is supported by your browser the         text inside the noscript tag will not be shown to you.     </p> </body>  </html> 

Output:

htmljs

Next Article
$ in JavaScript

S

shivanigupta18rk
Improve
Article Tags :
  • Web Technologies
  • HTML
  • HTML5

Similar Reads

  • DHTML JavaScript
    DHTML stands for Dynamic HTML. Dynamic means that the content of the web page can be customized or changed according to user inputs i.e. a page that is interactive with the user. In earlier times, HTML was used to create a static page. It only defined the structure of the content that was displayed
    3 min read
  • JavaScript HTML DOM
    The JavaScript HTML DOM (Document Object Model) is a powerful tool that represents the structure of an HTML document as a tree of objects. It allows JavaScript to interact with the structure and content of a webpage. By manipulating the DOM, you can update the content, structure, and styling of a pa
    4 min read
  • JavaScript innerHTML
    The innerHTML property in JavScript is used to append the dynamic HTML or text content to an element using JavaScript. It is designed to add dynamic HTML, but developers also use it to add text content as well. It can be directly used with the element by selecting it using DOM manipulation. Syntax:s
    2 min read
  • $ in JavaScript
    In JavaScript, a dollar ($) sign is not considered a built-in operator or a special symbol. The dollar sign ( $ ) is just another character that can be used in variable names. It is just like any other letter that can be used as the first or subsequent character in a variable name. Table of Content
    2 min read
  • History of JavaScript
    Brendan Eich developed JavaScript, a computer language, in just ten days in May 1995. Initially called Mocha, then LiveScript, it finally became known as JavaScript. It was designed for the client-side of websites to add dynamic and interactive elements to static HTML pages. History of JavaScriptJav
    4 min read
  • JavaScript Glossary
    JavaScript is one of the most widely used programming languages for web development. This glossary concisely explains key JavaScript terms and concepts, making it easier to understand and reference them. Arrays: Used to store multiple values in a single variable. They are zero-indexed and can hold m
    6 min read
  • HTML Superscript
    Superscript refers to a style of text formatting where characters are set slightly above the normal line of text and are usually rendered in a smaller font size. Examples of superscript usage include: Exponents in mathematics: x2Chemical isotopes: 14COrdinals: 1st, 2ndHow to Use Superscript in HTML?
    2 min read
  • JavaScript Hello World
    The JavaScript Hello World program is a simple tradition used by programmers to learn the new syntax of a programming language. It involves displaying the text "Hello, World!" on the screen. This basic exercise helps you understand how to output text and run simple scripts in a new programming envir
    2 min read
  • JavaScript Basics
    JavaScript is a versatile, lightweight scripting language widely used in web development. It can be utilized for both client-side and server-side development, making it essential for modern web applications. Known as the scripting language for web pages, JavaScript supports variables, data types, op
    6 min read
  • How JavaScript Works?
    JavaScript is a dynamically typed, cross-platform threaded scripting and programming language, used to put functionality and interactivity at the client side as well as to write logic on the server side of a website. It can display content updates, interactive maps, control multimedia, interactive f
    14 min read
geeksforgeeks-footer-logo
Corporate & Communications Address:
A-143, 7th Floor, Sovereign Corporate Tower, Sector- 136, Noida, Uttar Pradesh (201305)
Registered Address:
K 061, Tower K, Gulshan Vivante Apartment, Sector 137, Noida, Gautam Buddh Nagar, Uttar Pradesh, 201305
GFG App on Play Store GFG App on App Store
Advertise with us
  • Company
  • About Us
  • Legal
  • Privacy Policy
  • In Media
  • Contact Us
  • Advertise with us
  • GFG Corporate Solution
  • Placement Training Program
  • Languages
  • Python
  • Java
  • C++
  • PHP
  • GoLang
  • SQL
  • R Language
  • Android Tutorial
  • Tutorials Archive
  • DSA
  • Data Structures
  • Algorithms
  • DSA for Beginners
  • Basic DSA Problems
  • DSA Roadmap
  • Top 100 DSA Interview Problems
  • DSA Roadmap by Sandeep Jain
  • All Cheat Sheets
  • Data Science & ML
  • Data Science With Python
  • Data Science For Beginner
  • Machine Learning
  • ML Maths
  • Data Visualisation
  • Pandas
  • NumPy
  • NLP
  • Deep Learning
  • Web Technologies
  • HTML
  • CSS
  • JavaScript
  • TypeScript
  • ReactJS
  • NextJS
  • Bootstrap
  • Web Design
  • Python Tutorial
  • Python Programming Examples
  • Python Projects
  • Python Tkinter
  • Python Web Scraping
  • OpenCV Tutorial
  • Python Interview Question
  • Django
  • Computer Science
  • Operating Systems
  • Computer Network
  • Database Management System
  • Software Engineering
  • Digital Logic Design
  • Engineering Maths
  • Software Development
  • Software Testing
  • DevOps
  • Git
  • Linux
  • AWS
  • Docker
  • Kubernetes
  • Azure
  • GCP
  • DevOps Roadmap
  • System Design
  • High Level Design
  • Low Level Design
  • UML Diagrams
  • Interview Guide
  • Design Patterns
  • OOAD
  • System Design Bootcamp
  • Interview Questions
  • Inteview Preparation
  • Competitive Programming
  • Top DS or Algo for CP
  • Company-Wise Recruitment Process
  • Company-Wise Preparation
  • Aptitude Preparation
  • Puzzles
  • School Subjects
  • Mathematics
  • Physics
  • Chemistry
  • Biology
  • Social Science
  • English Grammar
  • Commerce
  • World GK
  • GeeksforGeeks Videos
  • DSA
  • Python
  • Java
  • C++
  • Web Development
  • Data Science
  • CS Subjects
@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy
Lightbox
Improvement
Suggest Changes
Help us improve. Share your suggestions to enhance the article. Contribute your expertise and make a difference in the GeeksforGeeks portal.
geeksforgeeks-suggest-icon
Create Improvement
Enhance the article with your expertise. Contribute to the GeeksforGeeks community and help create better learning resources for all.
geeksforgeeks-improvement-icon
Suggest Changes
min 4 words, max Words Limit:1000

Thank You!

Your suggestions are valuable to us.

What kind of Experience do you want to share?

Interview Experiences
Admission Experiences
Career Journeys
Work Experiences
Campus Experiences
Competitive Exam Experiences