Skip to content

Instantly share code, notes, and snippets.

@Jagathishrex
Last active August 1, 2019 18:31
Show Gist options
  • Save Jagathishrex/35f5dc05aef2435523f5194cdadcb463 to your computer and use it in GitHub Desktop.
Save Jagathishrex/35f5dc05aef2435523f5194cdadcb463 to your computer and use it in GitHub Desktop.
Using an external Javascript file
File_Name -> index.html
<!DOCTYPE html>
<html lang="en">
<head>
<title>First Javascript Program</title>
</head>
<body>
<button onclick="sayHi()"> Say hi </button>
</body>
<script src"script.js" > </script>
</html>
function sayHi() {
alert("hi");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment