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:

 write a JS function that enables or disables the textarea when

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

Select color: Select shirt size: Is this a gift? Write your gift message here:

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!