Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript

H Yang
H Yang
2,066 Points

I want to be able to extract information from an incoming HTML.

I'd like to be able to do something like manipulate the DOM and extract content according to class & id tags. Is there something I can use to accomplish something like that with an incoming HTML?

Thank you.

1 Answer

Rohald van Merode
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree
Rohald van Merode
Treehouse Staff

Hi H Yang,

I'm not entirely sure what you mean with incoming HTML but you can definitely manipulate any HTML elements in the DOM. If you haven't done so already I'd suggest to checkout the JavaScript and the DOM and Interacting with the DOM courses where you'll learn all about DOM manipulation 🙂

Hope this helps, if not it'd be great if you could share a snippet of code or elaborate a bit further on what it is you want to accomplish 🙂

H Yang
H Yang
2,066 Points

Thank you Rohald van Merode! By "incoming HTML" I meant an HTML document I called for and a server is sending to me. I'd like to collect some text; I've been able to using the browser console on the site I'm visiting with

document.getElementsByClassName("CLASS NAME HERE")[0].innerText

Now I'm looking to do so in my IDE.