[] Some of the techniques commonly used techniques developed by js

1, console.log special usage:

% C add special symbols can be printed out style

console.log("%c djsakiasjdkasjdkjas","font-size:60px;color:#999;font-weight:bold")

 2, a random color

// generates a random hexadecimal codes such as: '# c618b2' '#' + Math.floor (Math.random () * 0xffffff) .toString (16) .padEnd (6, '0');
3、本地时间
通过一堆HTML,您可以创建一个本地时间,其中包含您可以一口气读出的源代码,它每秒都会用当前时间更新页面。
// Create local time 
<body the onload = " setInterval (() => 
document.body.innerHTML = new new a Date (). ToLocaleString (). Slice (10, 19)) "> 
</ body>

 

 

Guess you like

Origin www.cnblogs.com/xiaohuizhang/p/12071424.html