CJCoding With Joseph
15per day

Change Image Source

Select the image with id="profilePic" and change its src attribute to "avatar.png".

Platform-Provided HTML (READ-ONLY):
<div id="userProfile">
  <img id="profilePic" src="default.png" alt="Profile Picture">
</div>

Steps:
1. Use document.getElementById() to select the image
2. Change its src attribute to "avatar.png"

Expected Output:

<div id="userProfile">
  <img id="profilePic" src="avatar.png" alt="Profile Picture">
</div>
Topics:
HTML DOM
Code Editor
1
Tab to indent ยท Ctrl+Enter to run ยท Ctrl+Space to expand shortcuts (clog, fn, fori)

Your Output

Run your code to see the output here...

Test Cases

Run your code to see test case results.