Script does'nt display in page : I tried this but it does'nt display inside the page. Where is the problem ?

          $content ='
                    <div class="row">
                      <div class="col-md-9">
                        <div class="form-group row">
                          <label for="' . $this->app->getDef('text_products_favorites') . '" class="col-5 col-form-label">' . $this->app->getDef('text_products_favorites') . '</label>
                          <div class="col-md-5">
                            ' . HTML::checkboxField('products_favorites', 'yes', false) . '
                          </div>
                        </div>
                      </div>
                    </div>      
          ';
    
    
          $output = <<<EOD
    <script>
    $('#tab9Content').prepend(
        '{$content}'
    )
    </script>
    EOD;
            return $output;

If I change the script by this, it work fine and the information is displayed in the page

    $('#orange h1').after(
        '<h3>Brown</h3>' + 
        '<p>Brown Brown Brown</p>'
    )

now in products.php

     <div class="adminformTitle" id="tab9Content">
    </div>

If I edit mycode I have this.

    <div class="adminformTitle" id="tab9Content">
    <script>
    $('#tab9Content').prepend(
        '
                    <div class="row">
                      <div class="col-md-9">
                        <div class="form-group row">
                          <label for="text_products_favorites" class="col-5 col-form-label">text_products_favorites</label>
                          <div class="col-md-5">
                            <input type="checkbox" name="products_favorite" id="products_favorite" value="yes" />
                          </div>
                        </div>
                      </div>
                    </div>      
          '
    )
    </script>
    </div>

