Search
 
SCRIPT & CODE EXAMPLE
 

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 
    });
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: vue append component to div 
Javascript :: var countdown = function(num) {} 
Javascript :: How to Loop Through an Array with a for…of Loop in JavaScript 
Javascript :: sort items 
Javascript :: expact 
Javascript :: useEffect : react to manipulate the DOM 
Javascript :: how to set javascript load order in html 
Javascript :: supabase 
Javascript :: Backbone Sync And Fetch 
Javascript :: how to check if a div tag contains child 
Javascript :: close popup after 5 seconds in jquery 
Javascript :: get number of new document firebasse 
Javascript :: update excel file in react js using sheetjs 
Javascript :: password generator and password strength using javascript 
Javascript :: array max in javascript 
Javascript :: classes in js 
Javascript :: javascript change checkbox state 
Javascript :: password validation in javascript 
Javascript :: switch statement javascript 
Javascript :: sweetalert2 redirect after ok 
Javascript :: _.union 
Javascript :: stripe confirm card payment {ESNext} 
Javascript :: js spin wheel color 
Javascript :: javascript include too large or too small numbers 
Javascript :: javascript Read Only View of an Object 
Javascript :: JavaScript Validation API 
Javascript :: datatable all items in one line 
Javascript :: How to Update the Props of a Rendered Component in vue Testing Library 
Javascript :: find minimum 
Javascript :: phaser remove animation event 
ADD CONTENT
Topic
Content
Source link
Name
3+3 =