With Complete Solutions
Course
ECSA 102
Question 1
Which HTML element is used to create a hyperlink to another webpage?
A. <link>
B. <a>
C. <href>
D. <url>
Answer
B. <a>
Rationale
The anchor (<a>) element creates hyperlinks. The destination is specified using the href attribute.
Example:
<a href="https://example.com">Visit Example</a>
Question 2
Which CSS property controls the text color of an element?
A. font-color
B. text-style
C. color
D. background-color
Answer
C. color
Rationale
The color property specifies the foreground (text) color.
, Example:
p{
color: blue;
}
Question 3
Which HTTP request method is primarily used to retrieve information from a web server?
A. POST
B. DELETE
C. GET
D. PUT
Answer
C. GET
Rationale
GET requests retrieve resources without modifying server data and are considered safe and
idempotent for most use cases.
Question 4
Which JavaScript function displays a dialog box with a message?
A. print()
B. console.log()
C. alert()
D. promptBox()
Answer
C. alert()
Rationale
alert() displays a modal dialog containing a specified message.