Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Javascript : Populate Etsy tags to the Title Input
function makeArray() {
var arr = [];
arr[0] = document.querySelectorAll(".tag.tag-left")[0].innerText.trim();
arr[1] = document.querySelectorAll(".tag.tag-left")[1].innerText.trim();
arr[2] = document.querySelectorAll(".tag.tag-left")[2].innerText.trim();
arr[3] = document.querySelectorAll(".tag.tag-left")[3].innerText.trim();
arr[4] = document.querySelectorAll(".tag.tag-left")[4].innerText.trim();
arr[5] = document.querySelectorAll(".tag.tag-left")[5].innerText.trim();
arr[6] = document.querySelectorAll(".tag.tag-left")[6].innerText.trim();
arr[7] = document.querySelectorAll(".tag.tag-left")[7].innerText.trim();
arr[8] = document.querySelectorAll(".tag.tag-left")[8].innerText.trim();
arr[9] = document.querySelectorAll(".tag.tag-left")[9].innerText.trim();
arr[10] = document.querySelectorAll(".tag.tag-left")[10].innerText.trim();
arr[11] = document.querySelectorAll(".tag.tag-left")[11].innerText.trim();
arr[12] = document.querySelectorAll(".tag.tag-left")[12].innerText.trim();
return arr.toString().replace(/,/g, ' ')
}
document.getElementById('title').value = makeArray();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment