Modules

filter

 

Objects/Functions

module (N/xml)

SuiteScript 2.0

Element.setAttribute(options)

{Element}.setAttribute({name: {string},value: {string}})

N/xml Module
Element.setAttribute()
Method Description: Adds a new attribute with the specified name. If an attribute with that name is already present in the element, its value is changed to the value specified in method argument. If an attribute with the specified name already exists, the value of the attribute is changed to the value of the value parameter.
Returns: void
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.setAttribute(options)

Example:

// Code Example 1
//Add additional code
//...
elem[0].setAttribute({
name : 'lang',
value : 'fr'
});
//...
//Add additional code

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