Difference: 1. HTML is a markup language and JS is a scripting language. 2. HTML provides static content on web pages, and JS adds dynamic functions to static web pages. 3. HTML is based on W3C and WHATWG standards, and JS is based on ECMA standards. 4. HTML is cross-browser compatible, while JS lacks cross-browser compatibility.
The operating environment of this tutorial: windows7 system, HTML5&&javascript version 1.8.5, Dell G3 computer.
What is js?
js full name JavaScript is a high-level, interpreted programming language. JavaScript is a prototype-based, function-first language. It is a multi-paradigm language that supports object-oriented programming, imperative programming, and functional programming.
Javascript consists of three parts:
ECMAScript: describes the syntax and basic objects of the language;
Document object Model (Document Object Model, referred to as DOM)): describes the methods and interfaces for processing web page content;
Browser Object Model (referred to as BOM)): describes and the browser Methods and interfaces for interaction.
JavaScript is one of the core technologies of the World Wide Web in addition to HTML and CSS. JavaScript powers interactive web pages and is an important part of web applications. The vast majority of websites use it, and major web browsers have dedicated JavaScript engines to execute it.
JavaScript is a network scripting language that has been widely used in Web application development. It is often used to add various dynamic functions to web pages to provide users with smoother and more beautiful browsing effects.
What is html?
HTML, Hyper Text Markup Language, is an application under the standard universal markup language. HTML is not a programming language, but a markup language, which is necessary for web page production. It includes a series of tags. These tags can unify the document format on the network and connect scattered Internet resources into a logical whole. HTML text is descriptive text composed of HTML commands. HTML commands can describe text, graphics, animations, sounds, tables, links, etc.
Hypertext is a way of organizing information that associates words and graphics in the text with other information media through hyperlinks. These interrelated information media may be in the same text, may be other files, or may be files on a computer that are geographically distant. This way of organizing information connects information resources distributed in different locations in a random manner, making it easier for people to find and retrieve information.
The difference between JS and HTML
1. Essential difference
HTML is a markup language, JavaScript is a Scripting language.
2. Usage difference
HTML provides static content on the web page. JavaScript adds dynamic functionality to static web pages.
JavaScript can be embedded in HTML, but HTML cannot be embedded in JavaScript.
3. Standardization difference
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, whether old or new, handle unrecognized elements as inline elements by default, which makes it easy for older web browsers to handle unknown HTML elements.
On the other hand, JavaScript lacks cross-browser compatibility, which makes some functions incompatible with certain browsers.
[Recommended learning: javascript advanced tutorial]
The above is the detailed content of What is the difference between js and html. For more information, please follow other related articles on the PHP Chinese website!