+ 1

Need help in Js

when i press reset i need the character counting to get back to 0....i did the function but it dont work... 10x https://code.sololearn.com/WIo41pPYBCop/?ref=app

22nd Jun 2017, 8:18 PM
Elie Douaihy
Elie Douaihy - avatar
4 odpowiedzi
+ 2
Although "clear" is not a reserved word, it conflicts with other global property/scope. Therefore rename that function name to something else (such as "clearCounters"), and update the HTML code. And set the values to 0 on reset ("event.target.value.length" seems unnecessary there).
22nd Jun 2017, 8:41 PM
Alex
+ 9
// Delete the onreset event // from your HTML file // Put this rather than // your clear function onload = function () { document.getElementById("canc").onclick= function(){ document.getElementById("count_p").innerHTML=("char: 0 ")+"" ; alert("Reset Done!"); } }
22nd Jun 2017, 8:31 PM
Maz
Maz - avatar
0
thank you All...Problem was that i used js property clear()...changed it to update_h
22nd Jun 2017, 8:50 PM
Elie Douaihy
Elie Douaihy - avatar
0
@maz- who are you? you are like the warlord of code on here lol. I'm truly impressed with you
23rd Jun 2017, 12:31 AM
Karey Montrel Heyward
Karey Montrel Heyward - avatar