How to edit HTML script tag of Google Trends in website?

82 Views Asked by At

I would like to embed Google trends data into my website, for this I am using below code. The code works fine. However, I would like to remove "Argentina","Recently Trending searches" and "Google Trends" that is getting displayed at the top and bottom of the container, as circled red in below image. I am trying to use replaceAll function but text are still getting displayed. My question is how to achieve this ?

Note: I am using Chrome as a browser, and below code is in index.html file

HTML Code

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Google Trends Argentina</title>
</head>

<body>
    <div id="trends"></div>

  <script type="text/javascript" src="https://ssl.gstatic.com/trends_nrtr/3349_RC01/embed_loader.js"></script>
  <script type="text/javascript">
    trends.embed.renderWidget("dailytrends", "", {"geo":"AR","guestPath":"https://trends.google.com:443/trends/embed/"});
    var footer = document.querySelector(".tt-footer");
    var innerHTML = footer.innerHTML;
    innerHTML = innerHTML.toString();
    innerHTML = innerHTML.replaceAll("Argentina", "&nbsp;");
    innerHTML = innerHTML.replaceAll("Recently Trending searches", "&nbsp;");
    footer.innerHTML = innerHTML;
  </script>


</body>

</html>

Output of above code: enter image description here

0

There are 0 best solutions below