Selecting and modifying an HTML element with JavaScript

Report a typo
Hey there! This problem might be a bit unpredictable, but give it a go and let us know how you do!
Given the block of HTML below, which of the following JavaScript functions can be used to select the element with the id 'myElement', change its class to 'newClass' and set 'Hello, world!' as its content?
<div id='myParent'>
  <p id='myElement' class='oldClass'>I'm a paragraph.</p>
</div>
Select one or more options from the list

Create a free account to access the full topic