The value of selected variable is "Topic [9]" or "Category [10]". i want to remove "[number]" from the value of selected variable?
selected = $('#topic_id option:selected').text();
i think, i can strip value with replace() as follows but need to know, how do i achieve because number is not fixed.
selected = $('#topic_id option:selected').text().replace();