Modules
Objects/Functions
SuiteScript 2.0
{Element}.hasAttribute({name: {string}})
N/xml Module
Element.hasAttribute()
Method Description:
Returns true if the current element has an attribute with the specified name or if that attribute has a default value. Otherwise, returns false.
This method is not supported on Internet Explorer.
Returns:
boolean
Supported Script Types:
All script types
For more information, see SuiteScript 2.0 Script Types.
Governance:
None
Module:
N/xml Module
Since:
2015.2
Search NetSuite -
https://system.netsuite.com/app/help/helpcenter.nl?search=Element.hasAttribute(options)
Example:
// Code Example 1
//Add additional code
//...
var attrExists = elem[0].hasAttribute({
name : 'lang'
});
//...
//Add additional code
//SOURCE: https://system.netsuite.com/app/help/helpcenter.nl?fid=section_453276306152.html