When learning to code in Javascript I'd just write my problem in Google then copy and paste the first solution in StackOverflow. I didn't understand what the code did as long as it worked I was good.
If you want quick solutions to your problems I'd recommend using https://htmldom.dev/
It doesn't have all the use cases of the DOM but it's a good starting point. Also, a great resource to read for problems you may have in the future.
That website is a good resource, but I recommend trying to understand what the code does every time, especially if you are a beginner. You don't need to memorize it, but understanding is important otherwise you will not be able to continue working on your project later or debug it.
100% agree, not understanding code then copy and paste was my approach when I first started programming. Now I every time I find a solution on the internet I try to understand what the author did before implementing his code in my projects.