title: how to replace document.write with innerHTML
body: <p>I want to replace the document.write with innerHTML. but it won’t create the links when I try it. I don’t know if there is an issue of how I am building the path variable so it won’t print out the links right. Right now it won’t print out any links.</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html lang="en"&gt;
  
  &lt;script&gt;
  
      var path = "";
      var href = document.location.href;
      var s = href.split("/");
      for (var i=2;i&lt;(s.length-1);i++) {
          path+="&lt;a class='crumb'  href=\""+href.substring(0,href.indexOf("/"+s[i])+s[i].length+1)+"/\"&gt;"+s[i]+" &lt;/a&gt;";
      }
      i=s.length-1;
      path+="&lt;a class='crumb'  href=\""+href.substring(0,href.indexOf(s[i])+s[i].length)+"\"&gt;"+s[i]+" &lt;/a&gt;";
      var url =  path;
      //document.getElementById(".breadcrumb").innerHTML = url;
      document.write(url);
  
  &lt;/script&gt;
  
  &lt;head&gt;
  &lt;meta charset="utf-8"&gt;
  &lt;meta http-equiv="X-UA-Compatible" content="IE=edge"&gt;
  &lt;meta name="viewport" content="width=device-width, initial-scale=1"&gt;
  &lt;link rel="stylesheet" href="/webjars/bootstrap/3.3.6/css/bootstrap.min.css"&gt;
  &lt;link rel="stylesheet" href="/webjars/bootstrap-fileinput/4.2.7/css/fileinput.min.css"&gt;
  &lt;link rel="stylesheet" href="/webjars/bootswatch/3.3.5+4/yeti/bootstrap.min.css"&gt;
  &lt;link rel="stylesheet" href="/webjars/font-awesome/4.5.0/css/font-awesome.min.css"&gt;
  &lt;link rel="stylesheet" href="/webjars/jquery-ui/1.12.1/jquery-ui.min.css"&gt;
  &lt;link rel="stylesheet" href="/static/app/css/app.css"&gt;
  &lt;link rel="stylesheet" href="/static/app/css/style.css"&gt;
  &lt;script src="/webjars/jquery/2.1.4/jquery.min.js"&gt;&lt;/script&gt;
  &lt;script src="/webjars/jquery-ui/1.12.1/jquery-ui.min.js"&gt;&lt;/script&gt;
  &lt;script src="/webjars/bootstrap-fileinput/4.2.7/js/fileinput.js"&gt;&lt;/script&gt;
  &lt;script src="/webjars/bootstrap/3.3.6/js/bootstrap.min.js"&gt;&lt;/script&gt;
  &lt;script src="/webjars/bootstrap-fileinput/4.2.7/js/fileinput_locale_ja.js"&gt;&lt;/script&gt;
  &lt;script src="/static/app/js/app.js"&gt;&lt;/script&gt;
  
  &lt;style&gt;
  
  .breadcrumb
  {
    witdh : 100%;
    text-align: center;
    border: 5px solid transparent;
  }
  
  .crumb
  {
   display: inline-block;
   float : left;
   font: 16px Helvetica, Arial, Sans-Serif;   
   color: white;
   background-color: #4E95B6;
   border: 1px solid black;
  }
  .crumb: hover
  {
   color: red;
  }
  
  &lt;/style&gt;
  
  &lt;/head&gt;
  
  &lt;body&gt;
  
  {{&gt;partials/browser-compatibility}}
  &lt;div class = "breadcrumb"&gt; &lt;/div&gt;
  &lt;div class="container-fluid"&gt;
  </code></pre>