Select the following Topics you are interested
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.
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>
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>
Click the link for downloading the plugin.
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