Error: Failed to execute ‘appendChild’ on ‘Node’: parameter 1 is not of type ‘Node’
It’s actually a simple answer. Your function is returning a string rather than the div node. appendChild can only append a node. For example, if you try to appendChild the string: The above code will never work. What will work is: