Question 16
Consider the following JavaScript code.
File name: index.html
<!DOCTYPE html><html> <head> <p> Course name - Course </p> </head> <body> <script src="script.js"></script> </body></html>File name: script.js
const para = document.querySelector('p');para.addEventListener('click', updateName);function updateName() { const cname = prompt('Enter your Course'); para.textContent = 'course name:' +cname;}Suppose the script is running locally and if the input given as “APP Development” then what will be rendered by the browser?
course name: course
course name: APP Development
APP Development
course: App Development