Is there a way to position an HTML element in relation to another using CSS or JavaScript? I have attempted to copy the inner HTML of the "second-element" and append it inside the "first-element", but this approach is causing issues with other functionalities. I am looking for a CSS or JS solution that does not require altering the HTML structure.
<body>
<div id=“first-element”>
<p>— Choose course —</p>
<!— The second-element should appear here —>
</div>
<div id=“second-element”>
<ul>
<li>Maths<li>
<li>Science</li>
</ul>
</div>
</body>