JavaScript in HTML
In HTML, JavaScript makes the web more flexible and interactive. JavaScript plays a rather important role for websites. If you want to verify this, you can try turning off JavaScript in your browser and browsing the web to see if anything is wrong.
- What is JavaScript? Can the Internet exist without JavaScript?
- Enable and disable JavaScript on Chrome browser
- Arrays and objects in JavaScript are like stories and newspapers!
You can copy the code below and run it in the browser to see a little bit about how JavaScript will help web pages.
My First JavaScript
Card
Some examples of JavaScript
Change HTML content
document.getElementById("demo").innerHTML = "Xin chào JavaScript!";
Change style in HTML
document.getElementById("demo").style.fontSize = "25px";
document.getElementById("demo").style.color = "red";
document.getElementById("demo").style.backgroundColor = "yellow";
Change HTML properties
document.getElementById("image").src = "picture.gif";
Card
Card
Previous post: Iframe in HTML
The following article: File path in HTML
4 ★ | 1 Vote
You should read it
May be interested
- File path in HTMLthe article explains how to refer to the file path in html.
- Head element in HTMLin html, the element is a set containing metadata (metadata) placed in tags and tags.
- 10 best free HTML editing tools for Windows 2018a good html editor must have a spell checker, line number, autocomplete, page preview and a text and image editing tool. there are many types of editing tools (text, object and wysiwyg), so it is important to find an appropriate tool.
- Layout in HTMLwebsites often display content in the form of columns (like in newspapers or magazines).
- Design website running on multiple devices (responsive web design) in HTMLresponsive web design just uses html and css to automatically resize, hide, minimize, enlarge a website.
- How to insert CSS to create styles for HTML pageswhen the browser reads the format file (stylesheet), it will format the html text according to the information in that format file.