Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

How to remove added values with javascript

/*Please give a thumbs up if this was helpfull*/

$('#toggle1,#toggle2,#toggle3').click(function() {
    toggleText(this.innerHTML); 
});


function toggleText(text)
{
    $(".text").each(function() {           
       $(this).val($(this).val().split( /circle|square/ ).join("") + " " + text); //remove existing circle or square and then add text 
    });
}
 
PREVIOUS NEXT
Tagged: #How #remove #added #values #javascript
ADD COMMENT
Topic
Name
5+6 =