0

in prototype I have this 'if' statement that works fine:

if(parentForm.hasAttribute('action')){
 console.log('hello world')
}

However, how do I turn this into a 'if parentForm DOES NOT have attribute action' statement?

Many thanks, Adi.

1 Answer 1

1

Simply negate the conditional using the logical not operator;

if(!parentForm.hasAttribute('action')){
 console.log('hello world')
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.