Answer the question
In order to leave comments, you need to log in
How to check if there are other tags in a tag or tags and delete them?
How to check if there are other tags in a tag or tags and delete them?
This entry doesn't work: if(redactorText. match(/(<([^>]+)>)<\/p>/ig))
<textarea class="js-redactor"></textarea>
$('.js-redactor').on('change', function(){
var redactorText = $(this).val();
var regex = /(<([^>]+)>)/ig;
if(redactorText.match(/<p>(<([^>]+)>)<\/p>/ig)) {
//этот код убирает все теги в textarea, а не между тегами <p></p> или <p><ins></ins></p>
redactorText = redactorText.replace(regex, "");
$(this).val(redactorText);
}
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question