Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // CSS
- .pf-option-swatches div {
- flex-direction: column;
- }
- // JS
- const pfSwatches = document.querySelectorAll('.pf-option-swatches > div');
- pfSwatches.forEach(option => {
- const input = option.querySelector('input');
- let spanTitle = document.createElement("span");
- spanTitle.className = "span-title";
- spanTitle.innerText = `${input.value}`;
- option.appendChild(spanTitle);
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement