Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add inline JS code in Drupal CKEditor 5?

Trying to add my JS code to custom block in Drupal 9.5.3 with CKEditor 5. But JS code is not running there.

custom block

I tried adding code using code button in tool bar of CKEditor. But doesn't working.

In the older version of Drupal 8 I used to write the JS script in the custom blocks itself.

So, How can I add my JS scripts in editor itself?

like image 218
vjprabhakar Avatar asked Dec 06 '25 18:12

vjprabhakar


1 Answers

Here i tried my script without selecting option which is shown in your given image just clicking on source added js script enter image description here

set text editor as full html this worked for me


Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!