In this situation, for example, if $(this).text() becomes 0, it will not work since in the switch 0 is not equal to “0”.
In my assignment, I cannot remove ” ” from case.
So basically $(this).text() has to become a string somehow. Any ideas?
Thanks!
...
$( '.xyz' ).click( function()...
var key = $(this).text();
switch( key ) {
case "0":
case "00":
case "1":
case "2":
case "3":
case "4":
case "5":
case "6":
case "7":
case "8":
case "9":
...
Try this