Search...
content
Sets or gets the element's content.
Description
The content
property is an object used to set and get the content of the Rich Content Viewer element.
The object can be referenced in 2 ways:
- In a rich content field of a collection.
- In other Wix apps that utilize rich content, such as Wix Blog.
Assigning null
to this property resets the content to undefined
.
Type:
Object
Read & Write|
nullWas this helpful?
Get rich content from a field and set it to a variable
Copy Code
1import wixData from 'wix-data';23$w.onReady(function () {4 wixData.query('MyCollection').find().then(results => {5 const data = results.items[0].richcontent;6 $w('#richContentViewer').content = data;7 });8});
Reset the Rich Content Viewer's content to
undefined
Copy Code
1$w("#myRichContentViewerElement").content = null;