Question: write a JS function that enables or disables the textarea when the checkbox is clicked. Instructions image: EXAMPLE/HINT When accessing a checkbox element in JS
write a JS function that enables or disables the textarea when the checkbox is clicked. Instructions image:

EXAMPLE/HINT
When accessing a checkbox element in JS via the DOM, you can examine the boolean checked which will be true or false. For example: var checkbox = document.getElementbyId("name of your checkbox id"); checkbox.checked will be either true or false. You can also change the status of the text area as follows: var textarea = document.getElementbyId("name of your text area id"); textarea.disabled = true; /* makes the text area usable */ textarea.disabled = false; /* makes the text area unusable */
HTML CODE
Order Information
PLEASE WRITE DOWN THE JS BELOW
Order Information When the checkbox is "unchecked", the text area should be disabled. Select color: White . Select shirt size: Is this a gift? Write your gift message here: Large-$11.99 This is the default when the page starts. Type your nessage here When the checkbox is "checked", the text area property "disabled" should be set to "false" (which enables the text area so the user can type in text). Order Information Select color: white . Select shirt size: large $11 99 Is this a gift? Write your gift message here: Type your message here
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
