»
Tiếng AnhTiếng PhápTiếng Việt

In - Tô màu đoạn vãn bản - JavaScriptBank.com

Phiên bản đầy đủ: jsB@nk » Linh tinh » Tô màu đoạn vãn bản
URL: https://www.javascriptbank.com/the-powerfull-text-effect.html

Tô màu đoạn vãn bản © JavaScriptBank.comHiệu ứng sẽ tô đỏ khối vãn bản bạn chọn.

Phiên bản đầy đủ: jsB@nk » Linh tinh » Tô màu đoạn vãn bản
URL: https://www.javascriptbank.com/the-powerfull-text-effect.html



JavaScript
<SCRIPT language=JScript>function selector(){if (document.all && document.getElementById){obj = document.body.createTextRange();obj.moveToElementText(TextToSelect);var sel = document.selection;if (sel!=null) {    var rng = sel.createRange();if (rng!=null && rng.compareEndPoints("StartToStart",obj)==1 && rng.compareEndPoints("EndToEnd",obj)==-1) rng.pasteHTML("<font style='background-color:red;color:white;'>" + rng.htmlText + "</font>");   else sel.empty();}}}document.onmouseup = selector;</SCRIPT><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->


HTML
<DIV id=TextToSelect>The powerfull text effect - Electronic marker. Try to select this text The powerfull text effect - Electronic marker. Try to select this text The powerfull text effect - Electronic marker. Try to select this text The powerfull text effect - Electronic marker. Try to select this text The powerfull text effect - Electronic marker. Try to select this text The powerfull text effect - Electronic marker. Try to select this text The powerfull text effect - Electronic marker. Try to select this text The powerfull text effect - Electronic marker. Try to select this text The powerfull text effect - Electronic marker. Try to select this text The powerfull text effect - Electronic marker. Try to select this text The powerfull text effect - Electronic marker. Try to select this text The powerfull text effect - Electronic marker. Try to select this text The powerfull text effect - Electronic marker. Try to select this text The powerfull text effect - Electronic marker. Try to select this text The powerfull text effect - Electronic marker. Try to select this text The powerfull text effect - Electronic marker. Try to select this text The powerfull text effect - Electronic marker. Try to select this text The powerfull text effect - Electronic marker. Try to select this text </DIV><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->