I found this example on w3schools.com and it should be working(it works on the website) but it doesn't work when I write it on my IDE(Atom).the home page is looking good but when I clicking the button nothing happened and it's not loading the demo_test.txt file. what am I doing wrong? or maybe something is missing?
home.html
$(document).ready(function(){
$("button").click(function(){
$("#div1").load("demo_test.txt");
});
});
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
</head>
<body>
<div id="div1"><h2>Let jQuery AJAX Change This Text</h2></div>
<button>Get External Content</button>
</body>
</html>
demo_test.txt
jQuery and AJAX is FUN!!!
This is some text in a paragraph.
<script>tag right before</body>.