Here is the text.html:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<h1>Voilla!</h1>
<p>I am a text loaded with AJAX request</p>
</body>
</html>
And the solution (HTML+JS):
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title></title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="https://code.jquery.com/jquery-3.2.1.js"></script>
</head>
<body>
<div id="text">
<h1>AJAX jQuery.load()</h1>
<button onclick="loadTitle()">Load Title</button>
</div>
<script>
function loadTitle() {
$("#text").load("text.html");
}
</script>
</body>
</html>
only the function:
function loadTitle() {
$("#text").load("text.html");
}