This is my code in which I am trying to replace Dollar Symbol $
with INR(Indian Rupee) using jQuery, however it is not working as this is only a specimen code so it is not ul >li
and find text
and replace text
kinda thing, my tries goes like this- I tried to first gather whole HTML and then replace $
sign with the code, but its not making anyhow.
My assumption - in $(document).ready()
using $(this)
inside this snippet refers to the document, let me know if this is a false assumption, as I tried my attempts keeping this thing in mind.
Please DO NOT
give any links/referrals to do it in CSS way or Webrupee API usage, keep it simple to jQuery this time :)
My Code -
<!DOCTYPE html>
<html>
<head>
<title>Rupee Change - jQuery Flavour</title>
</head>
<body>
<p>This is a price listing with $ sign, Now I wanted to replace each dollar sign with rupee symbol</p>
<ul>
<li>$ 500</li>
<li>$ 600</li>
<li>$ 700</li>
<li>$ 800</li>
<li>$ 900</li>
</ul>
<div id="showhtml"></div>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$(this).html().replace("$", "<del>र</del>");
});
</script>
</body>
</html>
FYI - I also tried this way of handling but not working :( find-text-string-using-jquery
र")); – Parthik Gosar Apr 20 '13 at 12:30