It was hanging at the clearBorders function. This function used a forof loop, which iterates through the values of an array. When I changed it to the older style that matches for in C or PHP, it worked. However, it did display legal moves, and the showLegal() function also uses forof loops. Maybe it just had a problem with using that kind of loop with an array of HTML elements. Anyway, it seems to be the only thing I had to change. Since I was already planning on it, I also removed showLegalFrom() and showLegalTo() while updating this function.
It was hanging at the clearBorders function. This function used a for of loop, which iterates through the values of an array. When I changed it to the older style that matches for in C or PHP, it worked. However, it did display legal moves, and the showLegal() function also uses for of loops. Maybe it just had a problem with using that kind of loop with an array of HTML elements. Anyway, it seems to be the only thing I had to change. Since I was already planning on it, I also removed showLegalFrom() and showLegalTo() while updating this function.