<script type="text/javascript">
$(document).ready( function() {
$(".editableContent").bind('paste', function() {
var value = $(this).text();
var string = value.replace(/(<([^>]+)>)/ig,"");
$(this).text(string);
});
});
</script>
Paste Function Does not work for first time but second time it works , why?
Looks like you’re trying to remove markup from your editable div. Just use this:
Here is a demonstration: http://jsfiddle.net/4jSNN/1/