MyTetra Share
Делитесь знаниями!

<script> Tag

The HTML <script> tag is used to include either external script file or to define internal script for the HTML document. Following is an example where we are using JavaScript to define a simple JavaScript function −

<!DOCTYPE html>

      <title>HTML script Tag Example</title>
      <base href = "" />
      <script type = "text/JavaScript">
         function Hello() {
            alert("Hello, World");

      <input type = "button" onclick = "Hello();" name = "ok" value = "OK"  />


This will produce the following result, where you can try to click on the given button −

Note − To learn about how JavaScript works, kindly check a separate tutorial available at

Так же в этом разделе: