First I made function:
function createComment(template) {
let emoji = document.getElementById("emojis").value;
let comment = template.replace(/p/g, emoji)
document.getElementById("comment").innerHTML = "kok" ;
}
and in HTML button : <button type="button" onclick="createComment()">Go</button>
but, I wanted to remove template argument from function because button didn't work so I just reduced JS function to :
function createComment() {
//let emoji = document.getElementById("emojis").value;
//let comment = template.replace(/p/g, emoji)
document.getElementById("comment").innerHTML = "kok" ;
}
but even now developer tools report error Uncaught TypeError: Failed to execute 'createComment' on 'Document': 1 argument required, but only 0 present.
If I change function name to anything to anything else like from createComment to createCommentS and in button too it works. For some reason it just keeps on hanging of original function argument and it's stubborn doesnt wanna give up on asking argument. Why?