forked from Cepesp-Fgv/cepesp-r
-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.js
27 lines (20 loc) · 940 Bytes
/
script.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// Function to replace currency symbols
function replaceCurrencySymbols() {
// Get all elements on the page
var elements = document.getElementsByTagName('*');
for (var i = 0; i < elements.length; i++) {
var element = elements[i];
// Check if the element contains text
if (element.hasChildNodes() && element.firstChild.nodeType === Node.TEXT_NODE) {
var text = element.firstChild.textContent;
// Replace 'US$' with 'R$'
var replacedText = text.replace(/US\$/g, 'R$');
// Replace '$' with 'R$'
replacedText = replacedText.replace(/\$/g, 'R$');
// Update the element's text content
element.firstChild.textContent = replacedText;
}
}
}
// Run the replaceCurrencySymbols function when the page has loaded
window.addEventListener('load', replaceCurrencySymbols);