I am making a small bookmarklet for my classmates. I want to force spellcheck on a form that can be queried by
document.querySelector("#tinymce"). I can use
setAttribute to set spellcheck to true. However, this element doesn’t appear until you click on the comment box, when the site loads tinymce - if you don’t select the form, trying to get
tinymce returns null. Now when I select the form, I can paste into the console
document.getElementById("tinymce") and get an element. However, the bookmarklet
returns null, even after the element has appeared in the site.
Can bookmarklets recognize that a site has changed? How can I fix this?
You can try it out on the W3schools tryit editor: https://www.w3schools.com/code/tryit.asp?filename=GJQQ255JN169