How to check if tags contain only a specific character in jquery
<p>I am able to check if an input contains a specific character. But I want to know if that input text contains multiple of that character.</p>

<p>For example,</p>

<p>When I have only "," in a textbox, I am able to process the words before it, but I have to check if the whole textbox contains multiple comma's. For example when I press ",,,,".</p>

<p>Any help to check it would do.</p>

<p>Thanks</p>

<p>Here is my code:</p>

<pre><code>function changeSubject(current_value) {
    if (current_value != "," &amp;&amp; current_value != "") {
        var new_value = current_value.slice(0, -1);
        $(".main-tag-elements").append("&lt;span&gt;" + new_value + "&lt;a class='delete-tag'&gt;&lt;/a&gt;&lt;/span&gt;");
        $(".tag-input").val("");
        if ($("#ClassroomSubject").val() == "") {
            $("#ClassroomSubject").val(new_value);
        } else {
            $("#ClassroomSubject").val($("#ClassroomSubject").val() + "," + new_value);
        }
    }
}
</code></pre>
