// code" or ""."/> // code" or "".">

Home  >  Article  >  Web Front-end  >  Is script a css tag?

Is script a css tag?

藏色散人
藏色散人Original
2021-03-01 10:23:542546browse

script is not a CSS tag, but a tag in HTML. This tag is used to define client-side scripts, such as JavaScript; the script element can either contain script statements or point to external script files through the src attribute. Syntax "3f1c4e4b6b16bbbd69b2ee476dc4f83a//code2cacc6d41bbb37262a98f745aa00fbf0" or "b2249e4dd38dbd935d5b4336ecbd0aa42cacc6d41bbb37262a98f745aa00fbf0".

Is script a css tag?

The operating environment of this article: Windows 7 system, HTML5 version, Dell G3 computer.

HTML 3f1c4e4b6b16bbbd69b2ee476dc4f83a tag

3f1c4e4b6b16bbbd69b2ee476dc4f83a tag is used to define client-side scripts, such as JavaScript.

The script element can either contain script statements or point to an external script file through the src attribute.

The required type attribute specifies the MIME type of the script.

Common applications of JavaScript are image manipulation, form validation, and dynamic content updating.

Tips and Notes:

Note: If the code inside this element is not located in a function, then the code will be executed immediately when the page is loaded. Scripts following the f900b4fc197b16ab214eecf015bb6bd2 tag will be ignored.

Differences between HTML and XHTML

In HTML 4.01, the "language" attribute of the script element is deprecated.

In XHTML 1.0 Strict DTD, the "language" attribute of the script element is not supported.

HTML 4 and XHTML differ in how content in scripts is handled:

In HTML 4, the content type is declared as CDATA, which means that entities are not parsed.

In XHTML, the content type is declared as (#PCDATA), which means that the entity will be parsed.

This means that in XHTML, all special characters should be encoded, or everything should be nested in a CDATA section.

In order to ensure that the script in the XHTML document is parsed correctly, please use the following syntax:

<script type="text/javascript"><![CDATA[
  document.write("Hello World!")
//]]></script>

Example

Insert a piece of JavaScript in the HTML page:

<script type="text/javascript">
document.write("Hello World!")
</script>

【Recommended learning: HTML video tutorial

The above is the detailed content of Is script a css tag?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn