0

I am not sure why item count parentheses aren't being removed in this tiny fiddle example.

EDIT: Here is my result from looking at the working answer.

$.fn.itemcount = function(){
     var text = $(this).text();
     text = text.replace("(","").replace(")","");
     $(this).text(text);
};

$("#prc").itemcount();


$.fn.sidecartcost = function(){
  var el = $(this);
  var text = $(this).text();
  text = text.replace("Your sub total is", "").replace(". ", "");
  $(this).text(text);
};



$('.SideCartCost').sidecartcost();
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>

<div id="prc">(7 Items)</div>
<div class="blank">Woo</div>
<div class="SideCartCost">Your sub total is $300.03. </div>

1 Answer 1

3

you are not replacing the html/text of the div like so http://jsfiddle.net/x5jeL/1/

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.