Get the App
SLTechnology News&Howtos  ›  Development  › 

What are the differences between javascript and html

Shulou Source: shulou.com Published: 2022-06-03 07:08:55 11月12日 Update

This article is about the differences between javascript and html. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

Differences: 1, HTML is a markup language, JavaScript is a scripting language; 2, HTML provides static content on the web page, JavaScript adds dynamic functions to static web pages; 3, HTML is based on W3C and WHATWG standards, JS is based on ECMA standards; 4, HTML compatibility is better than JS.

The operating environment of this tutorial: windows7 system, javascript1.8.5&&HTML5 version, Dell G3 computer.

The difference between JavaScript and HTML

1. Essential difference

HTML is a markup language and JavaScript is a scripting language.

HTML, that is, Hypertext markup language (Hyper Text Markup Language), is an application under the standard general markup language. HTML is not a programming language, but a markup language (markup language), which is necessary for web page making.

JavaScript (usually abbreviated to JS) is a high-level, interpreted programming language. JavaScript provides syntax to manipulate text, arrays, dates, regular expressions, etc., and does not support Imax O, such as network, storage, graphics, etc., but these can be supported by its hosting environment.

2. Differences in usage

HTML provides static content on a web page. JavaScript adds dynamic functionality to static web pages.

JavaScript can be embedded in HTML, but HTML cannot be embedded in JavaScript.

3. Differences in standardization

HTML is based on W3C and WHATWG standards, and JavaScript is based on ECMA standards.

4. Compatibility difference

HTML is cross-browser compatible, which means it is compatible with all versions of all web browsers, including modern browsers. All browsers, old or new, treat unrecognized elements as inline elements by default, which makes it easy for old web browsers to deal with unknown HTML elements.

On the other hand, JavaScript lacks cross-browser compatibility, which makes some functions incompatible with some browsers.

Thank you for reading! This is the end of the article on "what are the differences between javascript and html". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!

Tags: Language browser browsing standard tag web page content static element compatibility between function dynamic more environment article programming language script processing support Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno macOS Shulou Technology MariaDB MySQL Xiaomi