Creating DOM elements with JavaScript and then append them to parent elements(