File tree Expand file tree Collapse file tree 2 files changed +16
-13
lines changed Expand file tree Collapse file tree 2 files changed +16
-13
lines changed Original file line number Diff line number Diff line change @@ -242,18 +242,5 @@ document.addEventListener("DOMContentLoaded", function() {
242242 e .preventDefault ();
243243 };
244244 });
245- var btn = document .getElementById (" copy-button" );
246- btn .onmouseover = function (e ) {
247- btn .firstChild .classList .remove (" fa-check" );
248- btn .firstChild .classList .add (" fa-clipboard" );
249- }
250- btn .onclick = function (e ) {
251- var text = document .getElementById (" curl" );
252- window .getSelection ().selectAllChildren (text);
253- navigator .clipboard .writeText (text .textContent );
254- btn .firstChild .classList .add (" fa-check" );
255- btn .firstChild .classList .remove (" fa-clipboard" );
256- e .preventDefault ();
257- };
258245});
259246</script >
Original file line number Diff line number Diff line change 2121 </ div >
2222 </ div >
2323 </ footer >
24+ <!-- JavaScript code -->
25+ < script >
26+ var btn = document . getElementById ( "copy-button" ) ;
27+ btn . onmouseover = function ( e ) {
28+ btn . firstChild . classList . remove ( "fa-check" ) ;
29+ btn . firstChild . classList . add ( "fa-clipboard" ) ;
30+ }
31+ btn . onclick = function ( e ) {
32+ var text = document . getElementById ( "curl" ) ;
33+ window . getSelection ( ) . selectAllChildren ( text ) ;
34+ navigator . clipboard . writeText ( text . textContent ) ;
35+ btn . firstChild . classList . add ( "fa-check" ) ;
36+ btn . firstChild . classList . remove ( "fa-clipboard" ) ;
37+ e . preventDefault ( ) ;
38+ } ;
39+ </ script >
2440</ body>
2541</ html>
You can’t perform that action at this time.
0 commit comments