Originally Posted by asifakhtar
I appreicate your effort but I extended Old Pedant's solution and I want opinion from everyone here whether this is the right approach or not.
Did my solution solve your problem or was there something wrong with it functionality-wise? If it did solve your problem, are you simply recoding it to try to learn how to code?
As for your code (in post 26), I can't test it since you didn't provide the testing context. You haven't shown your current HTML and (complete) script with this code integrated into it. Without the rest of the script, I don't know what the
keyword is referring to.
I will say that I think using
statements is a bad idea; there's no to use exception handling to solve this problem. Ditto for using the
method in production code; that method should only be used for testing.