I use these codes to change the value of a field. Only the first two lines run, I tried the rest of the code but it did not work and sometimes the message "Uncaught ReferenceError: $ is not defined" is displayed on the console.
document.getElementsByName('tmcp_textfield_6').value = Pak;
document.getElementById("tmcp_textfield_116202d52cbd078").value = Pak;
$("input[name='tmcp_textfield_6']").val(Pak);
document.getElementsByName("tmcp_textfield_6").value = 100;
document.getElementByname("tmcp_textfield_6").value = "100";
$("input[name='tmcp_textfield_6']").val(Pak);

jQueryinstead of$