ZaZaKi, a web developer Between Manchester UK & Rotterdam NL. © 2015-2024.

External JavaScripts in HTML head

This code inside the head in the HTML

<script>
$(document).ready(function(){
<!-- jQuery code goes here -->
});
</script>

Complete comde with the HTML

 

<!DOCTYPE html>
<html>
<head>

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>

<script>
$(document).ready(function(){
$("#toggleTBN").click(function(){
$("#toggleText").toggle();
});
});
</script>

</head>
<body>

<button id="toggleTBN">Toggle Text</button>
<h1 id="toggleText">Clicke Toggle Text to toggle this text !</h1>

</body>
</html>

 

Categroy:
Front-end , javascripts , JQuery