What you've done already works, if you dont have a i tag, the query will be empty and not have the class, if it exists it will check the class. But any ways, if you want to check the tag, or any other query selector, the jquery method is .is( "i" )
.is( "i" )
https://api.jquery.com/is/