Make sure to pick document followed by . and then getElementById, "messages".
document
.
getElementById
"messages"