Reputation: 4022
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.
Upvotes: 0
Views: 167
Reputation: 75317
Simply negate the conditional using the logical not operator;
if(!parentForm.hasAttribute('action')){
console.log('hello world')
}
Upvotes: 1