隆鎮,Patent News,Hacker News Twitter,Network security,Freelance Web Designer
Daily Examplet

jQuery Examplets and Examples

Select the following Topics you are interested

  1. Caret Plugin
  2. Format Plugin
  3. Table AddRow Plugin
  4. Truncator Plugin
  5. TrapKey Plugin
  6. Regular Expression plugin / Selector (regex)
  7. Output Plugin
  8. Loader Plugin
  9. Matt Glass Plugin
  10. Lens Plugin
  11. ClippedImage Plugin
  12. DefaultText Plugin
  13. Simple Tree-node
  14. Simple Tree-set
  15. Simple zoomGlass

Using the jCaret in textarea

Description

Paito Anderson has sent email to me on how to use the jCaret in textarea more than a month ago, I am sorry that I write this page so late. The following is an example on the jCaret in textarea. The current version has applied the fix being suggested by Андрей Юткин.

Demonstration


<input class="hightlight" type="button" value="highlight fox"/><br/>
<textarea class="classNameOfTextArea" style="width:200px;height:100px;">
This is what people do if he saw a fox in the forest...
</textarea>
<script type="text/javascript" src="/js/jquery.js"></script>
<script type="text/javascript" src="/js/jquery.caret.js"></script>
<script type="text/javascript">
(function($){
	$(document).ready(function(){
		$(".hightlight").click(function(){
			$(".classNameOfTextArea").caret("fox");
		});
	})
})(jQuery);
</script>

 


Copyright 2012 Cloudgen,
find Cloudgen in:linkedin