Are you asking why the thread was moved? When communicating in a forum, largely limited to written words - sometimes in a non-native language - be as clear as possible, almost as though you're talking to a 10-year old. Remember, all we know is what we read, and the context isn't always clear.
If you're asking why the thread was moved, it's because the forum is broken into areas, sub-forums, each attempting to address either specific topics or general areas of Java questions and discussions, all under the Java SE topic. Your thread was originally posted in the Java SE "What's Wrong With My Code" sub-forum which is where all new topics are dumped by default when the "Ask a Question" button is pressed in the upper-left corner of the forum screen. Since your thread is not about Java SE, it's not appropriate in that sub-forum, so I moved it to "Other Programming Languages" in the Cafe, the best place for your thread in this Java forum.
There are a few JavaScript-capable folks here, so you may get a response, but be patient. It may take some time.
BTW - Thanks for posting your code in code tags. That's a hurdle many don't clear successfully for several posts. I notice that the code is not indented at all - almost all lines start at column zero. Either code formatting was somehow lost in the copy/paste, or you don't indent your code. If the latter, please learn how to properly indent your code and in the future post indented code.
Be well, keep coding.