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() {
242
242
e .preventDefault ();
243
243
};
244
244
});
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
- };
258
245
});
259
246
</script >
Original file line number Diff line number Diff line change 21
21
</ div >
22
22
</ div >
23
23
</ 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 >
24
40
</ body>
25
41
</ html>
You can’t perform that action at this time.
0 commit comments