# How to use the <script> tag to define client-side JavaScript?

JavascriptWeb DevelopmentFront End Scripts

The HTML <script> tag is used for declaring a script within your HTML document. Through this, you can define client-side JavaScript.

Here are the attributes of the <script> tag −

Attribute
Value
Description
async
async
Specifies that the script is executed asynchronously.
charset
charset
Defines the character encoding that the script uses.
defer
defer
Declares that the script will not generate any content. Therefore, the browser/user agent can continue parsing and rendering the rest of the page.
src
URL
Specifies a URI/URL of an external script.
type
text/JavaScript application/ecmascript application/JavaScript text/vbscript
Specifies the scripting language as a content-type (MIME type).

## Example

You can try to run the following code to learn how to use the <script> tag to define client-side JavaScript

Live Demo

<!DOCTYPE html>
<html>
</html>