JSFiddle - React, Tailwind, and code Playground

by kosmos

HTML

<h1>Hello World</h1>

<textarea rows="10" cols="40"></textarea><br />
<button onclick="myFunction()">change max length</button>

<script>
    function myFunction() {
    var text = document.getElementsByTagName("textarea")[0];
    text.setAttribute("maxlength", 100);
}
</script>