Javascript Jquery Replacewith Inside Loop Malfunction Stack Overflow

Javascript Jquery Replacewith Inside Loop Malfunction Stack Overflow