0

I am trying to get my browser extension to show the current date and time when I click on itThe code I currently have displays the date and time correctly in browser, but not in the extension.

Html Code:

<html>
    <body>
 <div class="centre2" >
        <div style="display:flex">
            <div>
                <a href="popup.html" ><img src="images/a.png" width="30" height="30" style="padding:7px;"/a>
            </div> 
             <div>
                 <a href="popup.html"> <img src="images/b.png"  width="30" height="30" style="padding:7px;"/a>
             </div>
    <div>
                 <a href="stratinium.com"> <img src="images/c.png"  width="30" height="30" style="padding:7px;"/a>
             </div>
        </div>
  </div>
  <br><br>
  <hr><br>
  <p class="marquee">
    <span id="dtText"></span>
  </p>


   <style>
  html
  {
  width: 200px;
  overflow-y:hidden;
  }
  div.centre2{
   border: 2px solid black;
        border-radius: 5px;
  }
  .marquee {
   width: 180px;
   margin: 0 auto;
   background:white;
   white-space: nowrap;
   overflow: hidden;
   box-sizing: border-box;
   color:black;
   font-size:18px;
}

.marquee span {
   display: inline-block;
   padding-left: 100%;
   text-indent: 0;
   animation: marquee 10s linear infinite;
}

.marquee span:hover {
    animation-play-state: paused
}

@keyframes marquee {
    0%   { transform: translate(0, 0); }
    100% { transform: translate(-100%, 0); }
}
  </style>
  <script>
  var today = new Date();
  document.getElementById('dtText').innerHTML=today;
  </script>
    </body>
</html>

Any help is appreciated!

  • Welcome to StackOverflow! Please take your time and read through this article. It can help you to improve your question, which makes it more likely that you get an answer: https://stackoverflow.com/help/mcve – Philipp Apr 07 '17 at 11:48
  • lots of information is missing. – Zig Mandel Apr 07 '17 at 11:55
  • 1
    You can't use inline JavaScript in a extension. Move your JavaScript code to a separate file (i.e. `myscript.js`) and import that file using `script>` tags: `` – Iván Nokonoko Apr 07 '17 at 12:05
  • Followed Your Suggestion. Worked. Thanks A Lot!! Iván Nokonoko – user5788447 Apr 07 '17 at 12:13

0 Answers0