Avatar of Tom Knowlton
Tom Knowlton
Flag for United States of America asked on

Correct way to determine if query result was found

I am attempting to determine if a div has a class with a certain name, then do something if it does:


        if ($('div[class*="onetime"]').length > 0)
        {
            alert("one time shipping mode");
        }
   

except the alert is firing no matter what.

What is the actual correct way to perform an action based on if a div contains an attribute with a certain phrase?
jQuery

Avatar of undefined
Last Comment
Tom Knowlton

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
leakim971

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Tom Knowlton

ASKER
thx
I started with Experts Exchange in 2004 and it's been a mainstay of my professional computing life since. It helped me launch a career as a programmer / Oracle data analyst
William Peck