Replaced jQuery's "is" from full jQuery with manual method