6502,cloudgen,jQuery Plugin book,Freelance Web Designer HK
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

Demonstration for the "Output Plugin"

Download the "Ouput Plugin"

The "Ouput Plugin" is included in the "format plugin" version 1.01.

The "Ouput Plugin" is quite simple that it is the combination of html() and val() function of jQuery. The output() function try to set or get the value of an text box, on the other hand, the function will change or get the inner HTML content if the tag is not a text box.

 

Examples

The followings are source code for the html tags:

<div id="test">
<span name="ex-number3digit" style="background:#F99">192</span>
<input name="ex-floatnumber" value="-3.14"/>
<span name="ex-words" style="background:#9F9">This is written in English.</span>
</div>
192This is written in English

 


1. Show the contents (value or html) within the <div> and </div> tags

<script type="text/javascript">
$("#showcontent").click(function(){
	$("#test *").each(function(){alert($(this).output());});
})
</script>

 

2. Set all the <span> inside <div> with content, "777"

<script type="text/javascript">
$("#setAll").click(function(){
	$("#test span").output("777");
})
</script>

Download the plugin

Click the link for downloading the plugin.

Copyright and licensing

All the plugin source codes and the examples are copyright of C. F., Wong
Please feel free to use any code listed in this page, they are licensed under the MIT License:
http://www.opensource.org/licenses/mit-license.php


Copyright 2012 Cloudgen