+ 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
4 Answers
+ 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).
+ 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!");
}
}
0
thank you All...Problem was that i used js property clear()...changed it to update_h
0
@maz- who are you? you are like the warlord of code on here lol. I'm truly impressed with you