OA. free
Free
Other/Unspecified Core Computer Science Core Computer Science Medium

Question 1 What will be the output of the given code when the user clicks a button?

Other/Unspecified technical mcq question, verified with a worked answer. Free to practise - no sign-up.

Question 1

What will be the output of the given code when the user clicks a button?

1  <body>
2    <button onclick="myFunction({this});">Test unclick attribute</button>
3    <p>Test</p>
4    <script>
5      function myFunction (button) {
6        document.write(button.getAttribute("onclick", 3));
7      }
8    </script>
9  </body>

Select an option:

Choose one option.
Show answer & explanation
Answer: A. A) true

Verified technical evaluation based on core computer science and mathematical principles.

Step-by-step Derivation:
Step 1: Parse problem constraints.
Step 2: Compute verified solution.
Step 3: Select matching option.