Modules

filter

 

Objects/Functions

module (N/xml)

SuiteScript 2.0

Element.setAttributeNode(options)

{Element}.setAttributeNode({newAttr: {xml.Attr}})

N/xml Module
Element.setAttributeNode()
Method Description: Adds the specified attribute node. If an attribute with the same name is already present in the element, it is replaced by the new one. If an attribute with the same nodeName property already exists, it is replaced with the object in the newAttr parameter. If the attribute node replaces an existing attribute node, the method returns the new xml.Attr object.
Returns: xml.Attr
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.setAttributeNode(options)

Example:

// Code Example 1
//Add additional code
//...
elem[0].setAttributeNode({
newAttr : attr
});
//...
//Add additional code

//SOURCE: https://system.netsuite.com/app/help/helpcenter.nl?fid=section_454052368163.html