JavaScript Script Tag

Run JavaScript inside an HTML document using the script tag.

Preview

Code

<button onclick="hello()">Click me</button>

<script>
function hello(){
  alert("JavaScript is running");
}
</script>

More JS Syntax Examples (7)