Is there any way to access the innerHTML of an external HTML file using javascript or jQuery? For instance, let's say I have HTML File A open in my browser with associated javascript functions written into it. When I hit a button on HTML File A I'd like my javascript functions to search through the innerHTML that's located in HTML File B that's in the same file folder as HTML File A.
The code would look like this:
HTML File A:
<script>
var source = $("#sampleDiv").html();
var search = source.search("text");
</script>
HTML File B:
<div id="sampleDiv">Here's some text.</div>
I'm trying to keep these in separate files to keep my code clean. The contents of HTML File B that I'm using in rl is quite lengthy so I'd like to keep my code in HTML File A clean by separating the two.