set Function

nano > def > set
Sets the innerHTML or value of the node. If "mode" is specified, "before" will add the first argument before the current innerHTML or value of the node, and "after" will add after the current innerHTML or value. Returns the handler.

Summary

ElementFunction
ReturnsObject

Arguments

valstring|number[required] Value to set as the new innerHTML or value.
modereplace|before|afterInsert mode of the new value. (default) replace

Example

handler.set(' - Hello!', 'after');