var time1 = getCookieexpireTime; 吧这个js里面的输出到indexhtml
在index.html文件中,可以使用以下代码将time1的值输出到HTML页面上:
<p>The value of time1 is: <span id="time1"></span></p>
<script>
// Get the value of the expireTime cookie
var time1 = getCookie("expireTime");
// Set the value of the time1 span element to the value of time1
document.getElementById("time1").innerHTML = time1;
</script>
这将在页面上创建一个段落元素,并在其中添加一个空的span元素,用于显示time1的值。然后,使用JavaScript代码获取cookie的值,并将其设置为span元素的innerHTML,从而将其显示在页面上。
原文地址: https://www.cveoy.top/t/topic/7XX 著作权归作者所有。请勿转载和采集!