mirror of
https://github.com/feathericons/feather.git
synced 2023-08-10 21:13:24 +03:00
25 lines
602 B
HTML
25 lines
602 B
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<title>Feather</title>
|
|
</head>
|
|
<body>
|
|
|
|
<div class="svg-container"></div>
|
|
|
|
<script>
|
|
const iconName = 'square';
|
|
|
|
fetch(`./icons/${iconName}.svg`)
|
|
.then(response => response.text())
|
|
.then(svgText => {
|
|
const svgDocument = new DOMParser().parseFromString(svgText, 'image/svg+xml');
|
|
const svgIcon = svgDocument.querySelector('svg').cloneNode(true);
|
|
const svgContainer = document.querySelector('.svg-container');
|
|
|
|
svgContainer.appendChild(svgIcon);
|
|
});
|
|
</script>
|
|
</body>
|
|
</html> |