Product Bundles
DevCraft
All Telerik .NET and Kendo UI JavaScript components and AI Tools in one package.
Kendo UI
Bundle of AI Tools plus four JavaScript UI libraries built natively for jQuery, Angular, React and Vue.
Build JavaScript UI
Javascript
Telerik
Build modern .NET business apps
.Net Web
Cross-Platform
Desktop
Reporting and Documents
AI for Developers & IT
Ensure AI program success
AI Coding
AI Engineering
Additional Tools
Enhance the developer and designer experience
Testing & Mocking
Debugging
UI/UX Tools
CMS
Free Tools
Support and Learning
Productivity and Design Tools
Hi Team,
I would like to get selected text along with html tags but getting only plain text by using
editor.getSelection() or editor.getRange() methods. Please help me to get html selected text
Hello, Lavanya,
I am not entirely certain if I understand the exact requirement, however you can retrieve the parent element of the text node like this:
var selection = editor.getSelection(); console.log($(selection.anchorNode).parent()[0].outerHTML);
https://dojo.telerik.com/@gdenchev/EnEyewAj
If you select the text and then click on the button, you'll see the following result in the console:
Best Regards, Georgi Denchev Progress Telerik
Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.