insertBefore
The insertBefore()
method adds a Element to the end of the list of children of a element.
Example
local name = window.input("What is your name?","My name is ...")
local elm = document.createNode("p",{style="color:red"},string.format("Welcome %s",name))
document.querySelector("body").insertBefore(elm,1) -- Inserts at the front
Last updated
Was this helpful?