Get started with fg-appendaround CDN
MIT licensed
Appends HTML around an element, preserving position and styling: fg-appendaround library.
Tags:- responsive
- markup
Stable version
Copied!
How to start using fg-appendaround CDN
<!DOCTYPE html>
<html>
<head>
<title>Get started with fg-appendaround CDN - cdnhub.io</title>
<script src="https://cdn.cdnhub.io/fg-appendaround/1.1.0/appendAround.min.js"></script>
</head>
<body>
<button id="append-button">Append Element</button>
<div id="target-element">Target Element</div>
<script>
document.addEventListener('DOMContentLoaded', () => {
const appendButton = document.getElementById('append-button');
const targetElement = document.getElementById('target-element');
appendButton.addEventListener('click', () => {
const newElement = document.createElement('div');
newElement.textContent = 'New Element';
FG_appendAround(newElement, targetElement, {
position: 'beforeBegin' // or 'afterEnd'
});
});
});
</script>
</body>
</html>
Copied!
Copied!