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

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?
Here i tried my script without selecting option which is shown in your given image just clicking on source added js script

set text editor as full html this worked for me
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With