I'm new to Javascript and I'm trying to copy text from all span elements with the class "copyme", sort them in reverse order, and concatenate the strings together. Once I do this, I am trying to add a paragraph containing this information to the div tag with id="copyhere"
Here's what I have so far:
var copy= document.getElementsByClassName("copyme").innerHTML;
var arr = [];
for (x = 0 ; x < copy ; x++){
arr.push(x);
}
arr.concat().reverse();
document.getElementById('copyhere').innerHTML = arr;
Nothing happens when I do this.
Any thoughts on how to proceed? Thank you.