You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To add a comment on a specific element through an API method, use the `addCommentOnElement()` method and pass in an object with the schema shows in the example:
95
94
95
+
**Example 1: Add comment with targetElementId only:**
96
+
96
97
<Tabs>
97
98
<Tabtitle="React / Next.js">
98
99
99
-
100
100
```jsx
101
-
102
101
constelement= {
103
102
"targetElement": {
104
-
"elementId":"element_id", // optional (pass elementId if you want to add comment on a specific element)
103
+
"elementId":"element_id", // optional (pass elementId if you want to add comment on a specific element)
105
104
"targetText":"target_text", // optional (pass targetText if you want to add comment on a specific text)
106
105
"occurrence":1, // optional (default: 1) This is relevant for text comment. By default, we will attach comment to the first occurence of the target text in your document. You can change this to attach your comment on a more specific text.
107
106
"selectAllContent":true, // Set to `true` if you want to select all the text content of the target element.
0 commit comments