<!DOCTYPE html>
<html xmlns:th="https://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

<div id="div">
saas
</div>

<script th:inline="javascript">
    let oglasi = /*[[${oglasi}]]*/ []
    let x=document.getElementById("div");
    s=''
    for(let i=0;i<10;i++)
    s+="<h1> CEVU NAJJACA GLAVA </h1>"
    x.innerHTML=s;
</script>






</body>
</html>