LZ.setValueFromElementId()

The LZ.setValueFromElementId() function sets (or updates) the value of the specified bucket to the specified element's value.
The function has the following signature:

setValueFromElementId(bucketName, elementId, mode = "text", forceChange = false)

Where:

If the element with the specified id does not exist, the action is aborted.

A simple example:

<p lz-reactive lz-bucket="myBucket></p>
<p id="content-paragraph">This is my content.</p>
<script>
    LZ.setValueFromElementId("myBucket", "content-paragraph");
</script>

If we specified "content" as the mode, content-paragraph could have had other HTML elements inside.

All the standard behaviour of LZ.setValue() applies to LZ.setValueFromElementId() too.

This is a faster version of LZ.setValueFromElement(). Prefer this whenever possible.

For an example on how to use this function, check out the tabs example.