I've working on something where I need to put the JS variables in a separate JS file (just in one HTML file for now). I want all the variables' text to be in JS instead of just putting them in jQuery. Here's what I have so far:
<!DOCTYPE HTML>
<html>
<head>
<title> </title>
<script src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
<script type="text/javascript">
var tempTitle = "Title";
var tempNavTitle = "Nav Title";
</script>
<script>
$("title").html(tempTitle);
$(".nav > .nav-id > .nav-title").html(tempNavTitle);
</script>
</head>
<body>
<div class="nav">
<div class="nav-id">
<div class="nav-title"> </div>
</div>
</div>
</body>
As you can see, I've already got the title part working, but the HTML part isn't working (and that's my issue).