I have got a few divs with numbers from 0 to 3200 and want to replace them with a character.
example of html:
<div>2</div>
<div>6</div>
<div>26</div>
example of jQuery:
$('div').text(function () {
return $(this).text().replace("1","K").replace("2","/").replace("3","@").replace("4","r").replace("5","[").replace("6","[").replace("7","[").replace("8",",").replace("9",",").replace("10","J").replace("11",",").replace("12",",").replace("13","P").replace("14","]").replace("15","]").replace("16","]").replace("17","R").replace("18","R").replace("19","N").replace("20","N").replace("21","N").replace("22","N").replace("23","W").replace("24","L").replace("25","d").replace("26","D").replace("27","(").replace("28","B").replace("29","b").replace("30","B").replace("31","a").replace("32","A").replace("33","f").replace("34","F").replace("35","[").replace("36",":").replace("37","@").replace("38","@").replace("39","!").replace("40","?").replace("41","Z").replace("42","]").replace("43","Z").replace("44","B").replace("45","@").replace("46","]").replace("47","@").replace("0","V").replace("3200","c");
});
What I have got for 2 - / correct, for 6 - [ correct, and for 26 - /[ wrong for 26 should be D.
Can you please help me with my jQuery code please? Live jsFiddle here: http://jsfiddle.net/UEy7w/