When I assigned a condition with onclick it is not working properly. I wanted to remove all my dynamic tr and at the value of td must be changed only if 1 tr is left. But after