Skip to main content

  | मौसम…

411 समाचार
Public archive edition · Attributed source reporting with original dates · AI drafts are excluded

411 REFERENCE · Wikibooks

JavaScript/Changing elements/Exercises

Reference material by Wikibooks contributors. This retains its source identity and is not 411 news reporting.

Topic: Change element's content and attributes We use the HTML page of the previous page for the exercises. 1. Modify the function show in a way that it disables the button. Its text shall change to "I'm disabled". Hint: To disable a button, its attribute disabled must be set to true. 100% function show() { "use strict"; const elem = document.getElementById("buttonShow"); elem.disabled = true; elem.innerHTML = "I'm disabled"; } 2. Modify the function show in a way that it opens the link in a new window: target="_blank". 100% function show() { "use strict"; const elem = document.getElementById("refToSomewhere"); elem.target = "_blank"; }