I create with JavaScript / JQuery IDs, which I can output afterwards with HTML.
Problem is that I can output each ID only once.
How can I implement that the ID can be output as often as I want?
I have created an example where I want to output the ID output
2 times.
Here is an example of what I mean:
if($('#output').length){
document.getElementById('output').innerHTML = 'Example output';
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div id="output">Load</div>
<p>Here is more page content</p>
<div id="output">Load</div>
I also created a fiddle if it helps more. https://jsfiddle.net/dfaLpv0h/