开发者

how to apply javascript to selected text of a textarea?

开发者 https://www.devze.com 2023-04-03 11:04 出处:网络
I want to apply some changes to the selected text of a text area only. I want to select a certain portion 开发者_如何学Cof a text written in the text area and want to make some changes on it by javas

I want to apply some changes to the selected text of a text area only.

I want to select a certain portion 开发者_如何学Cof a text written in the text area and want to make some changes on it by javascript.

Thanks


document.selection.createRange().text = "NEW TEXT";


I think the answer to this question might help you:

how-to-get-selected-text-from-textbox

It shows you selection of the text and you can use javascript to process it.

0

精彩评论

暂无评论...
验证码 换一张
取 消