W
W
webiru2018-01-24 07:33:00
TinyMCE
webiru, 2018-01-24 07:33:00

Tinymce how to write selector: ID correctly?

I can't connect tinymce to an element by ID
There are no problems with such IDs
tinymce.init({
selector: '#textarea, #qwe'
But I have an ID with square brackets, like asd[a_a]
And it seems that because of the square brackets it doesn't work anymore
This is not
how tinymce.init({
selector: '#asd[a_a], #qwe[s]'
How do I specify such IDs correctly?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
E
Evgeny Kalibrov, 2018-01-24
@rework

Escape the brackets with two backslashes:

tinymce.init({
selector: '#asd\\[a_a\\], #qwe\\[s\\]'

W
webiru, 2018-01-24
@webiru

Eh, I figured it out. Need to escape brackets
tinymce.init({
selector: '#asd\\[a_a\\], #qwe\\[s\\]'

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question