So I have this search, example I have this in my table "Test Building" and I can only search the first part of the name and its case sensitive like I input Test but I cant search if I type Building which is my problem so how do I correct this? here's what I did..
building.blade.php
<center>
    <div class="input-group col-xs-4 col-md-6" >
        <input type="text" name="search" id="search-building" class="form-control" placeholder="Search..." required>
        <span class="input-group-btn">
        </span>
    </div>
</center>
<script type="text/javascript">
    $("body").on("input", "#search-building", function() {
        var text_filter = $(this).val();
        var tr = $('tr');
        $("table").find("tbody").find("tr").hide();
        $("table").find("td").show();
        $("table").find("tbody").find("tr:contains("+text_filter+")").show();
    });
</script>
 
     
    