This repository has been archived on 2024-10-29. You can view files and clone it, but cannot push or open issues or pull requests.
FunctionProject/scripts/execute-function/armstrongNumber_DOM.js

14 lines
499 B
JavaScript
Raw Normal View History

import { armstrongNumber } from '../functions/fonctions_principales/armstrongNumber_Function.js';
$(function () {
$("#numberToTest").bind("keyup change", () => {
let numbersValue = $('#numberToTest').val();
numbersValue = parseInt(numbersValue.replace(/\s/g,''));
if (!isNaN(numbersValue) && numbersValue >= 0) {
$('.results').html(armstrongNumber(numbersValue));
}
else {
$('.results').html(messageError);
}
});
});