My option looks like this:
<option value="80">a1, a2, a3, a4, a5 (80)</option>
With this code:
str_split = str.split(',');
i receive this:
a1 a2 a3 a4 a5 (80)
But i want to remove the id with the braces to get this:
a1 a2 a3 a4 a5
The id can vary like "(8)"
or "(20)"
or "(100)"
and so on..
I tried it with
str_replace = str.replace(/[()]/g, "");
but it gives me this result:
a1 a2 a3 a4 a5 80
How do I do that?
EDIT :
is it possible to do this with the last braces with id from string?
just tested it and got problems when my option looks like this
<option value="80">a1(12), a2(test), a3(333), a4(xx), a5(34) (80)</option>
i want this
a1(12) a2(test) a3(333) a4(xx) a5(34)