estoy buscando obtener el valor del tiempo de la id = tiempo en segundo plano
y hacer que se muestre ese valor en lugar de tmee en el html compartido.
Si alguien puede ayudar, estoy trabajando en una extensión de Chrome.
cuando hago clic en la extensión de Chrome, obtiene una cadena en formato de tiempo de un enlace en segundo plano y la muestra si alguien puede ayudar. sin usar ninguna biblioteca externa Gracias
{ "manifest_version": 2, "name": "whatever", "description": "he he", "version": "1.0.1", "browser_action":{ "default_icon": "/images/icon.png", "default_popup": "hehe.html" }, "content_scripts": [ { "matches": ["https://www.utctime.net/ist-indian-time-now"], "js": ["hehe.js"] }], "background": { "scripts": ["hehe.js"], "persistent": false } } getTime = () =>{ time = document.getElementById("time").innerHTML //this element from the utc website sessionStorage .setItem('das2', time); return time }; document.getElementById("tmee").innerHTML = getTime();//not working document.getElementById("tmee").innerHTML =sessionStorage.getItem('das2');//not working <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <link rel="stylesheet" href="hehe.css"> <title>Whatever</title> </head> <body> <div class="container"> <p>Time Counter : <input id="h" type="number" max ="9" min="0" value="0" class="time"> <input id="m" type="number" max ="60" min="0" value="0" class="time"> <input id="s" type="number" max ="60" min="0" value="0" class="time"> </p> <p>Completion Percentage: <a id="time1"> b </a> </p> <p>Remaining minutes: <a id="tmee"> b </a></p> <p>Position: a</p> </div> <script src="hehe.js"> </script> </body> </html>