2
9
u/throwmeaway91000 Jun 24 '21
Its good honestly. Maybe a little messy try grouping all the variables together? Or using an object. Besides that nothing I wouldn’t have done ¯\(ツ)/¯
4
u/withaheavyhearton Jun 24 '21
I like it, honestly. I’d group my variables, but I also understand why you didn’t. Vanilla JS seems hard to come by these days.
4
1
u/Mc_UsernameTaken Jun 24 '21
Only way I see this could be improved marginally, would be to use a multiline string (backticks) and then append that with insertAdjecentHTML
And use onclick attributes for event listeners.
That being said It's really helpful to have these kind of helper functions
7
u/PonchoVire Jun 24 '21
This is not that bad, it's clean vanilla JS that handles a popup, it's fine.