D
D
Demon2015-09-30 09:25:58
css
Demon, 2015-09-30 09:25:58

How to remove text?

Help to remove text in div after comma.
Example:

<div id="div_test">Слово , после удалено все в див </div>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrew B., 2015-09-30
@freelancer

codepen.io/anon/pen/LpxWor

$("selector").each(function(){
    currentText = $(this).text();
    $(this).text(currentText.split(",")[0]);
});

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question