Need help with getting button id to work

Question:

How to make button id work?
Repl link:

https://CelebratedLavenderRoot.thetechnicalbirb.repl.co

code snippet
```<button id="abutton"></button>

Welcome to the community, @TheTechnicalBirb!

One thing I noticed in your code is that you used var. This is OK but it’s better to use let in most cases.
When you make a variable that isn’t going to change, for example the button, you should use const.

2 Likes

I think you should be seting the iframe’s href, not src, you should double check that. Also I think you should just set it to window.location.href, not whatever your doing with URLObject at the top.

2 Likes