It seems messy. Please describe the functions you need to implement. It may be possible without instructions. Now you come up with a bunch of browser-generated elements, which are not readable, and people don’t know what you want to do, so it’s hard to answer you. When asking questions, first say that you want to implement the description function, and then your code, which is your idea. You can post your results at the end, but it's not necessary.
It seems messy. Please describe the functions you need to implement. It may be possible without instructions. Now you come up with a bunch of browser-generated elements, which are not readable, and people don’t know what you want to do, so it’s hard to answer you. When asking questions, first say that you want to implement the description function, and then your code, which is your idea. You can post your results at the end, but it's not necessary.