I have a variable named position
where I want to remove some of its text. The exact text I want to remove is contained within the variable title
.
var title = $(currentLi).find('img').attr('alt');
var position = $(currentLi).find('span').text();
So just to clarify, I am creating a variable named position
which contained text, I want to remove all the text that matches the text within the variable title
.
Thanks for anyones help.
position = position.replace(title, "");
https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/String/replace
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With