text() method no longer works after loading a text file
text() method no longer works after loading a text file
alert returns nothing.
<script src="
https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<div id='first'></div>
<p></p>
<div id='second'></div>
<script>
$("#first").load("Matthew1.txt").css("white-space", "pre-line");
var result=$("#first").text();
alert(result);
</script>
It seems $("#first").text() doesn't work after the load().
Topic Participants
gunitinug
kbwood.au