I am using text plugin ( ck-editor ):
Below is my source:
<button onclick="location.href='http://www.example.com'" type="button">www.example.com</button>
After saving the text plugin, I could notice that the source under text plugin has changed as below:
<button type="button">www.example.com</button>
Am I using a wrong plugin? How to handle this case by preserving the link of the button.
The ckeditor sanitises content but you can specify additional tags & attributes as you can see here which shows you can provide these settings;
TEXT_ADDITIONAL_TAGS = ('iframe',)
TEXT_ADDITIONAL_ATTRIBUTES = ('scrolling', 'allowfullscreen', 'frameborder')
So you could add set TEXT_ADDITIONAL_ATTRIBUTES = ('onclick', )