I am getting the last element from a form which has a value like this:
var lastOne =$(':text[name^=distanceSlab][value!=""]').last();
now I want to find the element which has a class that begins with the string “limit”.
I have tried something like:
if(lastOne.is("class^='limit'")){
console.log('BEGINNING WITH LIMIT')
}
but it didn’t work. How do I do this?
You forgot to put
[]around the selector.