jQuery And Script Tags As Data Containers

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
	<title>jQuery And Script Tags</title>
	<script type="text/javascript" src="jquery-1.3.2.js"></script>
	<script type="text/javascript">
 
		// When DOM loads, initialize.
		$(
			function(){
				// Gather script block in our target DIV.
				var jScripts = $( "#scripts script" );
 
				// Get a reference to our output list.
				var jOutput = $( "#output" );
 
				// Loop over each script to copy the data from
				// the tag to the output list.
				jScripts.each(
					function( intI, objScript ){
						var jThis = $( this );
 
						// Append html of script tag to list.
						jOutput.append(
							"<li>" +
							jThis.html() +
							"</li>"
							);
					}
					);
 
			}
			);
 
	</script>
</head>
<body>
 
	<h1>
		jQuery And Script Tags
	</h1>
 
	<div id="scripts">
 
		<script type="text/plain">
			Plain text in script tag.
		</script>
 
		<script type="text/plain">
			More plain text in script tag.
		</script>
 
	</div>
 
	<ul id="output" />
 
</body>
</html>

For Cut-and-Paste