Skip to content

Latest commit

 

History

History
14 lines (11 loc) · 473 Bytes

File metadata and controls

14 lines (11 loc) · 473 Bytes

Ways of include javascript in HTML

In here we see how many ways we can include javascript code. Basically there are 3 ways to include Javascript in HTML.

First

Direct code within the <script> ... </script> tag

Example:-

Second

Include a external javascript file <script src='myscript.js'></script> Example:-

Code in inline

Add a code in between HTML tag <input type="button" value="Click here" onClick="alert('Hello')"> Example:-