I am trying to add a line to a page. If I write $('.txt')in the console, it returns:

If I write $('.txt'), it returns the first .txt.
If I write $('.txt').append('<div><span>TEEST</span></div>')in the console, it adds "TEEST" to everyone .txton the page.
But if I write $('.txt')[0].append('<div><span>TEEST</span></div>')
it returns:

Why is this? How can I add to a specific DOM element?
source
share