Unwrap string before attaching it to the document
===

I wrote the following code to append a new table row to my `#displayResult` table with the data I receive from my `#getInfo` form when it is submitted. 

I was asked to implement a WYSIWYG HTML editor in my textarea ([jHtmlArea][1]) so that users can add basic styling to their comments. It simply wraps the targeted content in `<b/>` or `<i/>` tags, for example.

In my table, only **previews** of the actual comments are displayed (limited to 40 characters) and I use PHP's `strip_tags()` to make sure no styling/unwanted tags appear in the displayed preview when the page has been refreshed.

In a nutshell, I'd like to apply the same treatment on my AJAX response so I'm basically looking for a JS way to emulate `strip_tags()` in this context.

My question is : how can I unwrap the comment and clear it from all the `<b/>` or `<i/>` tags **before** it is appended? Any ideas on how I can achieve this?

Thanks for your help.

    $('#getInfo').submit(function(e) {
    	e.preventDefault();
    
    	var company = $('select#company').val();
    	var name = $('input#name').val();
    	var comment = $('textarea#comment').val();
    	comment = comment.substring(0,40);
    	comment = comment + '...'; 
    	
    	var dataString = [company, name, comment];
    	var n = dataString.length;
        
    	$.ajax({
    		type: 'POST',
    		url: '../process.php',
    		data: $('#getInfo').serialize(),
    		success: function() {
    			
    			for(var i = 0; i < n; i++) {
    				row
    					.append($('<td>')
    					.html(dataString[i]))
    			}
    			
    			$(row).appendTo('#displayResult').hide().fadeIn('slow');
    		}
    	});
    });


  [1]: http://jhtmlarea.codeplex.com/