$() - Moving Elements jQuery Demo

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean sapien nisl, malesuada vitae, facilisis id, suscipit vitae, purus. Etiam velit felis, rhoncus vel, rutrum consequat, porta ut, enim.

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean sapien nisl, malesuada vitae, facilisis id, suscipit vitae, purus. Etiam velit felis, rhoncus vel, rutrum consequat, porta ut, enim.

$(
	function(){
	
		// Hook up click event for all links.
		$( "a" )
			.attr( "href", "javascript:void( 0 )" )
			.click(
				function(){
					$( this ).addClass( "highlight" );
					
					// Stop default action.
					return( false );
				}
				)
		;
		
		// Add double-click action to remove tag.
		$( "a" ).dblclick(
			function( objEvent ){
				$( this ).remove();
				
				// Prevent propogation of click.
				objEvent.stopPropagation();
			}
			);
		
	
		// Hook up click even on paragraph to append selected
		// link tags.
		$( "p" ).click(
			function(){
				var jLinks = $( "a.highlight" );
				
				// Remove class.
				jLinks.removeClass( "highlight" );
				
				// Add links to Paragraph.
				$( this ).append( jLinks );
			}
			);
			
		// Hook up double click on paragraph to remove links.
		$( "p" ).dblclick(
			function(){
				$( "pre" ).before( 
					$( this ).clone( true ) 
					);
			}
			);
				
	}
	);