SUBMIT
{"ScriptPreparationCode":"const card = { number: false, cvc: false, expire: false };\r\nlet submit = document.getElementById(\u0027submit\u0027);\r\nlet number = document.getElementById(\u0027number\u0027);\r\nlet cvc = document.getElementById(\u0027cvc\u0027);\r\nlet expire = document.getElementById(\u0027expire\u0027);\r\nconst onChangeHandler = function(event) {\r\n const key = event.target.id;\r\n if(!event.empty) {\r\n card[key] = true;\r\n card.cvc ? event.target.addEventListener(\u0027change\u0027, onChangeHandler): undefined;\r\n card.expire ? event.target.addEventListener(\u0027change\u0027, onChangeHandler): undefined;\r\n }\r\n card[key] ? event.target.removeEventListener(\u0027change\u0027, onChangeHandler): undefined;\r\n if(card.number \u0026\u0026 card.cvc \u0026\u0026 card.expire) {\r\n submit.removeAttribute(\u0027disabled\u0027);\r\n number.removeEventListener(\u0027change\u0027, onChangeHandler);\r\n cvc.removeEventListener(\u0027change\u0027, onChangeHandler);\r\n expire.removeEventListener(\u0027change\u0027, onChangeHandler);\r\n submit.innerText = submit.disabled.toString();\r\n }\r\n};\r\n","TestCases":[{"Name":"a","Code":"number.addEventListener(\u0027change\u0027, this.onChangeHandler);\r\n//cvc.addEventListener(\u0027change\u0027, this.onChangeHandler);\r\n//expire.addEventListener(\u0027change\u0027, this.onChangeHandler);\r\nnumber.value = \u00224242 4242 4242 4242\u0022;\r\nnumber.dispatchEvent(new Event(\u0027change\u0027));\r\ncvc.value = \u0022333\u0022;\r\ncvc.dispatchEvent(new Event(\u0027change\u0027));\r\nexpire.value = \u002202/22\u0022;\r\nexpire.dispatchEvent(new Event(\u0027change\u0027));","IsDeferred":false},{"Name":"b","Code":"number.addEventListener(\u0027change\u0027, this.onChangeHandler);\r\n//cvc.addEventListener(\u0027change\u0027, this.onChangeHandler);\r\n//expire.addEventListener(\u0027change\u0027, this.onChangeHandler);\r\nnumber.value = \u00224242 4242 4242 4242\u0022;\r\nnumber.dispatchEvent(new Event(\u0027change\u0027));\r\ncvc.value = \u0022333\u0022;\r\ncvc.dispatchEvent(new Event(\u0027change\u0027));\r\nexpire.value = \u002202/22\u0022;\r\nexpire.dispatchEvent(new Event(\u0027change\u0027));","IsDeferred":false}]}