javascript - Replace text except number using jQuery -


i'm trying replace text using jquery leaving number.

replacing text in jquery easy don't know lot regex leave number part alone.

here's html:

<div class="example">10 examples</div> 

what i'd change 10 examples else leaving number part in.

use parseint non regex solution.

$(".example").text(function(i, txt) {       return parseint(txt, 10) + " new message"; }); 

Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

javascript - jQuery .height() return 0 when visible but non-0 when hidden -