roman numerals chart embed code example
Example 1: roman numerals converter table embed
if (/^(0|[1-9]\d*)$/.test(arabic)) {
if (arabic == 0) {
outputField.innerHTML = "Nulla";
} else if (arabic != 0) {
for (let i = 0; i < arabicArray.length; i++) {
while (arabicArray[i] <= arabic) {
roman += romanArray[i];
arabic -= arabicArray[i];
}
}
outputField.innerHTML = roman;
}
} else {
outputField.innerHTML =
"Please enter non negative integers only. No decimal points.";
}
Example 2: roman numerals converter table embed
const inputField = document.querySelector('input');
const convertButton = document.getElementById('convert');
const outputField = document.getElementById('display');