Why is no one here abe to help me answer about my if arguements
When you click on the #convert-btn element without entering a value into the #number element, the #output element should contain the text Please enter a valid number.
Why is no one here abe to help me answer about my if arguements
When you click on the #convert-btn element without entering a value into the #number element, the #output element should contain the text Please enter a valid number.
Hi Syed, I’m a little perplexed by your question. Several of us (and I don’t speak for them and don’t even know anyone personally here) have tried giving you assistance. But let’s take a look at your first if statement. How can something not be equal to itself? This statement will always return false.
Now, my personal suggestion is that you put this project and this course on pause to work on your JavaScript and programming fundamentals. Try the legacy JavaScript course. You could also try the JavaScript prep course over at galvanize. There are some other JavaScript only courses out there too. You might also just play around with Google Apps Script and a Google spreadsheet.
if(number !== null && convert-btn.onclick("click")){
output.textContent = "Please enter a valid number"
}
if(number.value === ''){
result.textContent="Please enter a valid number";
}
else if (number.value < 1){
result.textContent="Please enter a number greater than or equal to 1";
}
else if (number.value >=4000){
result.textContent="Please enter a number less than or equal to 3999";
}
else if (number.value < 4000) {
let result = convertToRoman();
}
};
}
i have chagned my if statement but the test for this specific one is returning false maybe ishould take a pause like you said and come back im honestly stumped after countless attempts with the changes i have made and yet not passing
if(number === null & convert-btn.onclick("click")){
output.textContent = "Please enter a valid number"
}
hi im back after checking frm other places and have used console.log
and have updated my if arguements to null
however i feel like there is something wrong with the test
If (e.target.value === ‘’) {
//condition met if user enters no number
}
/
You can figure out how to get this into your solution
/* file: script.js */
const input = document.getElementById('number');
const getBtn = document.getElementById('convert-btn');
const outIst = document.getElementById('output');
const plsEnter = () => {
const inputT = input.value
if (inputT === '') {
outIst.innerText = 'Please enter a valid number'
return;
}
else if
(inputT < 1) {
outIst.innerText = 'Please enter a number greater than or equal to 1'
return;
} else if
(inputT > 3999) {
outIst.innerText = 'Please enter a number less than or equal to 3999'
return;
} else {
numCheker()
return;
}
}
const numCheker = () => {
const n = input.value;
const oblZnack = [
{
1: 'I',
4: 'IV',
5: 'V',
9: 'IX',
10: 'X',
40: 'XL',
50: 'L',
90: 'XC',
100: 'C',
400: 'CD',
500: 'D',
900: 'CM',
1000: 'M',
}
];
if (n = oblZnack) {
outIst.innerText = `${oblZnack}`;
while(n < oblZnack);
};
if (inputT > 9) {
outIst.innerText = 'IX'
}
};
getBtn.addEventListener('click', plsEnter);
@greatoyesola Please open your own thread if you need help.
If this is meant as help we do not allow solution code to be posted. But your code doesn’t work because it has errors so it isn’t solution code. I will blur it anyway because it can still contain spoilers.
This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.