title: Cannot set property 'onsubmit' of null in laravel when redirecting shows blank page
body: <p>Cannot set property 'onsubmit' of null in laravel when redirecting shows blank page
  my code</p>
  
  <pre><code>&lt;body&gt;
      &lt;section id="container" class=""&gt;
        @if (Auth::guard('admin')-&gt;check())
            @include('admin.header.header')
            @include('admin.sidebar.sidebar')
            @yield('content')
        @else
            @yield('content')
        @endif
      &lt;/section&gt;
  
       &lt;!-- javascripts --&gt;
    {!!Html::script('js/jquery.js')!!}
    {!!Html::script('js/jquery-ui-1.10.4.min.js')!!}
    ...........
    {!!Html::script('js/jquery.slimscroll.min.js')!!}
  
    &lt;/body&gt;
  </code></pre>
  
  <p>my error</p>
  
  <pre><code>VM1673:277 Uncaught TypeError: Cannot set property 'onsubmit' of null
      at &lt;anonymous&gt;:277:41
  </code></pre>
  
  <p>when i console it return null ,so the error is in this , what should i do </p>
  
  <pre><code>console.log(document.getElementById("subm"));
  </code></pre>
  
  <p>my script code is </p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
    function waitForLoad(id, callback){
      var timer = setInterval(function(){
          if(document.getElementById(id)){
              clearInterval(timer);
              callback();
          }
      }, 100);
  }
  
  waitForLoad("subm", function(){
      console.log("load successful, you can proceed!!");
      document.getElementById("subm").onclick = function()
      {
          alert("I got clicked");
      }
  });
  
  &lt;/script&gt;
  </code></pre>