Reformat Text for Blog
I wrote this for my blog. I have my blog set up so that I need to change all of my opening and closing tags (< >) for html elements to their html entity name element (< >). This can be done with a few lines of javascript.
$(function(){
$('#cleanFormat').click(function(){
$('#text').val($('#text').val().replace(/</g,"<"));
$('#text').val($('#text').val().replace(/>/g,">"));
});
});
To see an example of this follow this link.
No comments:
Post a Comment