(本ページで扱うのはES6以前のJavaScript(Vanilla JS)の話です)
element = document.getElementsByTagName("body"); var title = document.title; if(element[0]){ var childElement = document.createElement("span"); element[0].appendChild(childElement); childElement.innerHTML = "<span style= 'font-family:MS Pゴシック;position:absolute;top:740px;left:900px;] font-weight:bold;font-color:black;font-size:25px; background-color:white;width:74px;height:20px;z-index:1000;'>" + title + "</span>"; }
<input type="button" value="サブウィンドウを閉じる" onClick="window.close()">
<a href="javaScript:hoge_func()">実行する</a>
num.toLocaleString(undefined, {minimumFractionDigits: 2})
const date = new Date(2001, 0, 2, 3, 4, 5); const d = new Intl.DateTimeFormat("ja-jp", { year: "numeric", month: "2-digit", day: "2-digit", hour: "2-digit", minute: "2-digit", second: "2-digit", }).format(date); console.log(d); //=> "2001/01/02 03:04:05"
<script src="https://cdn.jsdelivr.net/npm/p5@1.4.0/lib/p5.js"></script> <script> a=(x,y,d=mag(k=x/8-25,e=y/8-25)**2/99)=>[(q=x/3+k*.5/cos(y*5)*sin(d*d-t))*sin(c=d/2-t/8)+e*sin(d+k-t)+200,(q+y/8+d*9)*cos(c)+200] t=0,draw=$=>{t||createCanvas(w=400,w);background(6).stroke(255,96);for(t+=PI/60,y=99;y<300;y+=5)for(x=99;++x<300;)point(...a(x,y))} </script>
javascript:( function(){ scroll(0,0); H='http://hamachiya.com/'; D=document; F=Math.floor; R=Math.random; Q=new Image; Q.src=H+'g1.gif'; L=function(){ var X=F(R()*vw); var Y=0; var r=F(R()*9)+3; var V=Z(X,Y); D.body.appendChild(V); var f=function(){ if(Y+r<vh){ V.style.top=(Y+=r)+'px' }else{ V.style.top=vh+'px'; V.src=H+'g2.gif'; setTimeout(function(){V.src=H+'g3.gif'},550); clearInterval(t); } }; var t=setInterval(f,40) }; Z=function(x){ var e=D.createElement('img'); e.src=Q.src; var s=e.style; s.position='absolute'; s.left=x+'px'; s.top=0; return e; }; var vw,vh; Q.onload=function(){ vw=(self.innerWidth|| D.documentElement.clientWidth||D.body.clientWidth) -Q.width; vh=(self.innerHeight|| D.documentElement.clientHeight||D.body.clientHeight) -Q.height; setInterval(L,800); Q.onload={} } } )()
javascript:(function(){var text =document.title+">"+document.URL; navigator.clipboard.writeText(text).then(e =>{alert('Copy OK!');});})();
javascript:(function(){var w = document.URL;if (w.indexOf('qiita.com') >= 0 && w.indexOf('?') >=0) {w = w.substr(0,w.indexOf('?'))}; var text=document.title+">"+w; navigator.clipboard.writeText(text).then(e =>{});})();