I can't find element by id
📝 Ask a question
How can I find an element by id? I have access to the editor instance. what method should I use? I want to replace it's content with another text.
Suggested solution is to use the setData().
Here is guide about it: https://ckeditor.com/docs/ckeditor5/latest/getting-started/setup/getting-and-setting-data.html#replacing-the-editor-data-with-setdata
Hi, thanks for the quick response.
I have a button that needs to find an element by it's id, but for some reason hasAttribute('id') is always false.
and getAttribute('id') is also always null
when I use getAttributes() it's returning objects like htmlPAttributes and ...
inside them if I go further I can find the id. but not directly
There has been no activity on this issue for the past year. We've marked it as stale and will close it in 30 days. We understand it may still be relevant, so if you're interested in the solution, leave a comment or reaction under this issue.
We've closed your issue due to inactivity. We understand that the issue may still be relevant. If so, feel free to open a new one (and link this issue to it).