Write the JavaScript to set the rows attribute of the tag to 6.

a) document.getElementById("textarea").rows = 6;
b) document.querySelector("textarea").rows = 6;
c) document.getElementsByTagName("textarea")[0].rows = 6;
d) document.forms[0].elements["textarea"].rows = 6;

Q&A Education