var styles = ['btx btx1', 'btx btx2', 'btx btx3', 'btx btx4'];
$('#mst').on('click', function(){
let a = $('#btx').attr('class');
console.log(a); // `btx btx2`
let x = styles.findIndex(a);
console.log(x); // error
});
error - Uncaught TypeError: btx btx2 is not a function
I'm expecting 1
as the result