in the example below the last class of a div is tex1 and I need it in console
something like this:
let last = $('#tex').attr('class').last();
console.log(last); // error
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div id='tex' class='tex texonly tex1'>lorem</div>