normal JavaScript codes does work but JavaScript DOM doesn't work in Laravel Voyager.
<script>
var url_slash_count = document.URL.replace(/[^\/]/g, "").length;
alert(url_slash_count);
if(url_slash.equals("4")) {
document.getElementById('right')style.display = "none";
}
</script>
<span id="right-arrow-button">
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="gray" class="bi bi-arrow-right" viewBox="0 0 16 16">
<path stroke="black" stroke-width="2" fill-rule="evenodd" d="M1 8a.5.5 0 0 1 .5-.5h11.793l-3.147-3.146a.5.5 0 0 1 .708-.708l4 4a.5.5 0 0 1 0 .708l-4 4a.5.5 0 0 1-.708-.708L13.293 8.5H1.5A.5.5 0 0 1 1 8z" onclick="history.forward()"/>
</svg>
</span>
when i add document.getElementById method other js codes doesn't work except this everything is working normally