Home  >  Article  >  Web Front-end  >  HTML script tutorial detailed explanation

HTML script tutorial detailed explanation

零下一度
零下一度Original
2017-05-17 16:31:051452browse

Online Example

Insert a script
How to insert a script into an HTML document.

Use the 2b0b25ff593c5b6c03403dd6234ffb2c tag
How to deal with browsers that do not support scripts or have scripts disabled.

HTML 3f1c4e4b6b16bbbd69b2ee476dc4f83a tag

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

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

JavaScript is most commonly used for image manipulation, form validation, and dynamic content updating.

The following script will output "Hello World!" to the browser:

Example

<script>
document.write("Hello World!")
</script>

Try it »

Tip: Learn more about Javascript For tutorials, check out the JavaScript Tutorial!

HTML2b0b25ff593c5b6c03403dd6234ffb2c Tag

2b0b25ff593c5b6c03403dd6234ffb2c The tag provides alternative content when scripts are not available, such as when scripts are disabled in the browser, or if the browser does not When client scripting is supported. The

2b0b25ff593c5b6c03403dd6234ffb2c element can contain all elements found within the body element of a normal HTML page.

Only when the browser does not support scripts or scripts are disabled, the content in the 2b0b25ff593c5b6c03403dd6234ffb2c element will be displayed:

Example

<script>document.write("Hello World!")</script><noscript>Sorry, your browser does not support JavaScript!</noscript>

Try it»

JavaScript experience (from this site’s javascript tutorial)

JavaScript example code:

JavaScript can be output directly in HTMl:

document.write("<p>This is a paragraph</p>");

Try it»

JavaScript event response:

<button type="button" onclick="myFunction()">Click Me!</button>

JavaScript processing HTML style:

document.getElementById("demo").style.color="#ff0000";

[Related recommendations]

1. Special recommendation "php Programmer Toolbox" V0.1 version download

2. Free html online video tutorial

3. php.cn original html5 video tutorial

The above is the detailed content of HTML script tutorial detailed explanation. 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