{ e.preventDefault() fetch('/images/dragon.svg') .then(response => response.text()) .then(svg => { // Create a temporary element to hold the SVG const temp = document.createElement('div') temp.innerHTML = svg // Get the SVG element const svgElement = temp.querySelector('svg') // Add a class to the SVG element svgElement.classList.add('svg-class') // Get the SVG as a string const svgString = new XMLSerializer().serializeToString(svgElement) // Copy the SVG to the clipboard navigator.clipboard.writeText(svgString) // Close the dropdown close($refs.button) }) }" class="flex w-full items-center gap-2 px-4 py-2.5 text-left text-sm first-of-type:rounded-t-md last-of-type:rounded-b-md hover:bg-primary hover:text-white focus:bg-primary focus:text-white">Copy SVG
View on OpenMoji
More emojis from Selina Bauder
Home
Projects
Blog
đ ī¸
Fun things I've made
node
2
three
2
js
2
11ty
1
alpine
1
tailwind
1
vue
1
playcanvas
1
angular
1
đĻ A simple Node.JS template
Node.js
âī¸ A light and fast personal blog
Eleventy
Alpine.js
Tailwind
đâ Building a WebGL Pool Configurator
Vue
PlayCanvas3D
đ˛ The Ancient Game of Ur
Angular
THREE.js
đļ Portal Ending Credits in JS
Vanilla JS
đšī¸ Cubefield with Three.JS
THREE.js
Vanilla JS
Edit this page
on github
.