Are we doing this right?

Can you please put together some sample HTML code, so that we can use the JavaScript code on it in a way that it’s expected to work?