To read the value from the input, you need to get a reference to it. For example:
function myFunction() {
const maxLength = document.getElementsByName("maxLength")[0];
const element = document.getElementById("textarea");
element.maxLength = parseInt(maxLength.value, 10);
}
Demo[
^]