1. Home
  2. Federal Board of Intermediate and Secondary Education (FBISE)
  3. Computer Science FBISE Class 9
  4. Which JavaScript method displays an alert box?

Added 9 Nov 2026

Which JavaScript method displays an alert box?

  1. msg()
  2. alert() Correct answer
  3. prompt()
  4. console.log()

Correct answer

B. alert()

15 views

MCQSEXAM

Explanation

alert() displays a message box with an OK button, e.g. alert("Hello");. prompt() asks the user for input, and console.log() writes to the browser console.

Keep preparing with more Computer Basics MCQs on MCQsExam.com.

Reference

Asked in: Matric,FBISE

Preparing for an exam?

Doubts & discussion

Not sure why the answer is B? Ask here and get an explanation.

Ask a doubt about this MCQ

Shown after review. No links please.

More Computer Science FBISE Class 9 MCQs

Practise all Computer Science FBISE Class 9 MCQs

Similar MCQs