Append element to atom


#1

I’d like to append an html element after another. Atom seems to use classes over ids. So in the find-and-replace (div) class and after the header-item options-label pull-right (span) class. How would I navigate to that position to do something like:

myElement = document.createElement('span')
myElement.classList.add('icon')

#panel = document.getElementByClassName()[0]?
panel.appendChild(myElement)

#2

You need to specify the hierarchy to pinpoint the element using classes with spaces. The more your specify the greater chance that the element you want will be the most specific. See http://specificity.keegan.st.