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 Object-Oriented JavaScript: Challenge Rendering the Game Render the Token

Rupertson Espinosa
Rupertson Espinosa
4,128 Points

I am not sure of what the get method requirement is referring to when it says it should return the html token element.

Is it referring to the html token that we just created in the drawHTMLToken() method?

1 Answer

Lee Vaughn
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree seal-36
Lee Vaughn
Treehouse Teacher

Hi Rupertson!

You want to return the element you are creating in the drawHTMLToken() method. Your best bet for doing that is probably to use the getElementById method.

Lee

Hi Lee,

Something is missing, who invokes the drawHTMLToken() method?

doesn't the getter method need to invoke it first? and then get the HTML element like you said? like so:

get htmlToken() {
    this.drawHTMLToken()
    return document.getElementById(this.id);
}