+ 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

3rd Oct 2018, 5:45 PM
Chidiadi Anyanwu
Chidiadi Anyanwu - avatar
5 Answers
+ 5
onkeyup="display(this)" var cost = document.getElementById('cost'); function display(el) { cost.innerHTML = "
quot; + el.value.length; }
3rd Oct 2018, 5:53 PM
Toni Isotalo
Toni Isotalo - avatar
+ 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
5th Oct 2018, 3:07 AM
Chidiadi Anyanwu
Chidiadi Anyanwu - avatar
+ 1
can it be name.value.length?
3rd Oct 2018, 6:04 PM
Chidiadi Anyanwu
Chidiadi Anyanwu - avatar
+ 1
Must it be el or the el here is just standing for a variable?
3rd Oct 2018, 6:05 PM
Chidiadi Anyanwu
Chidiadi Anyanwu - avatar
0
Don't multiply with *2
4th Oct 2018, 6:42 AM
Sunil
Sunil - avatar