I am trying to use Javascript to search a Wordpress page for a specific hexadecimal code and replace that code with another code. The code is #FF4500 and I would like to replace it with #FFFFFF. I've tried several solutions online already using JSFiddle but have not been able to get it to work.
The HTML:
<div style="padding:5px;background:#FF4500;text-align:center;">Some Text Here</div><br>
Here's what I tried:
$(document).ready(function() {
$('div').each(function () {
var $this = $(this);
$this.html($this.text().replace(*FF4500, FFFFFF));
});
});
`code` Here's what I tried: `code` $(document).ready(function(){ $('div').each(function () { var $this = $(this); $this.html($this.text().replace(*FF4500, FFFFFF)); }); }); `code` – user3100539 Dec 13 '13 at 19:10