How does this code work in a calculator to clear input? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How does this code work in a calculator to clear input?

<span class="num clear" onclick="document.cal.txt.value = ''">C</span>

1st May 2020, 8:39 PM
3.14
3.14 - avatar
1 Answer
0
document.cal.txt.value='' sets the input named 'txt' in the form named 'cal' to '' which is an empty single-quoted string
1st May 2020, 9:14 PM
Ore
Ore - avatar