Element doesn't exist

anyone know how to make if element doesn’t exist will be true in variable?

found solution using chat gpt