C
C
Carry2015-11-09 14:58:47
JavaScript
Carry, 2015-11-09 14:58:47

How to write a regular expression or something else?

Good afternoon!
For a long time I did not write regular seasons as superfluous. Need help.
I select a value from the CRUD table (but not so much from where).
When there is a match highlight (highlight) I get the following value:
<span class="ui-state-highlight">АЗИ</span>КАР
How do I remove and keep AZIKAR ?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander Wolf, 2015-11-09
@carryx

.replace(/<\/?.+?>/mig, '')

K
Konstantin Gromov, 2015-11-09
@Pathgk

// jQuery
$(".ui-state-highlight").each(function() {
  this.outerHTML = this.innerHTML;
});

// Native
var elements = document.querySelectorAll(".ui-state-highlight");

for (var i = 0; i < elements.length; i++) {
  elements[i].outerHTML = elements[i].innerHTML;
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question