Skip to content

Commit ce5a828

Browse files
committed
1 parent 9e9a598 commit ce5a828

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/signature_pad.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,13 @@ function init(Survey) {
6868
question.valueChangedCallback = updateValueHandler;
6969
updateValueHandler();
7070
question.signaturePad = signaturePad;
71+
var buttonEl = el.getElementsByTagName("button")[0];
7172
if (question.allowClear && !question.isReadOnly) {
72-
el.getElementsByTagName("button")[0].onclick = function() {
73+
buttonEl.onclick = function() {
7374
question.value = undefined;
7475
};
7576
} else {
76-
el.getElementsByTagName("button")[0].remove();
77+
buttonEl.parentNode.removeChild(buttonEl);
7778
}
7879
},
7980
willUnmount: function(question, el) {

0 commit comments

Comments
 (0)