the page became unresponsive when the while loop is working
<p>my page became unresponsive when my while loop is working </p>

<p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>$(".hidebutton").click(function () {
            var parented = $(".selected").data("id"); 
            var currentid = parented + 1; 
            while(true)
            {
                var chiledtrleft = $("tr[data-id='" + currentid + "']&gt; td:first-child").css("padding-left"); 
                var parentleft = $("tr[data-id='" + parented + "']&gt; td:first-child").css("padding-left"); 
                if (chiledtrleft &lt;= parentleft) {
                    break; 
                }
               
                $("tr[data-id='" + currentid + "']&gt; td:first-child").hide(); 
                // do shifting here

            }
        });</code></pre>
</div>
</div>
</p>

<p>what is the problem in my code?</p>