+ 2
Please could anyone help me out with this?
I need the code to show me. the number of letters I type. It's the JavaScript that I'm focusing on. For example, if I type "belch", it should show me $5. The code is attached below. Please help me of you can. https://code.sololearn.com/W69UMNd6A8U1/?ref=app
5 Respostas
+ 5
onkeyup="display(this)"
var cost = document.getElementById('cost');
function display(el) {
cost.innerHTML = "quot; + el.value.length;
}
+ 2
I've already gotten that. Thanks. I just put the cost variable definition and ask that into the display function and it worked perfectly. Check it out
https://code.sololearn.com/W69UMNd6A8U1/?ref=app
+ 1
can it be name.value.length?
+ 1
Must it be el or the el here is just standing for a variable?
0
Don't multiply with *2