- Type
- MCQs
- Course
- CS521 Web Systems and Technologies
- Size
- PDF 97 KB
- Updated
- 23 Oct 2026
You get 3 free files a day on the website. Add the Chrome extensionSign in with the extension for 30 a day.
Preview text
Text from pages 1, 2, 4 of 22. Download the file for all 22 pages.
**Modifying DOM Elements**
Q1. Which method is used to change the text content of an HTML element?
- a) `getElementById`
- b) `innerText`
- c) `innerHTML`
- d) `setAttribute`
- **Answer: c) innerHTML**
**Creating DOM elements**
Q2. How do you create a new HTML element in JavaScript?
- a) `document.createElement("div")`
- b) `document.newElement("div")`
- c) `createNewElement("div")`
- d) `createElement("div")`
- **Answer: a) document.createElement("div")**
**Event Handling**
Q3. Which of the following is used to attach an event handler to an element?
- a) `addEventListener`
- b) `attachEvent`
- c) `on Event`
- d) `setEvent`
- **Answer: a) addEventListener**
**Capturing and Bubbling**
Q4. Event capturing and bubbling are phases of which process?
- a) Event propagation
- b) Event delegation
- c) Event binding
- d) Event creation
- **Answer: a) Event propagation**
**Event Types**
Q5. Which event is fired when a user presses a key on the keyboard?
- a) `keydown`
- b) `keypress`
- c) `keyup`
- d) `keyclick`
- **Answer: a) keydown**
**Form Validation; Client Side Input Validation**
Q6. Which HTML attribute is used to specify that an input field must be filled out before submitting the form?
Q9. How do you hide an element using jQuery?
- a) `$("#element").hide();`
- b) `$("#element").display(false);`
- c) `$("#element").css("display", "none");`
- d) `$("#element").invisible();`
- **Answer: a) $("#element").hide();`
**Query Manipulators - Example**
Q10. Which jQuery method is used to change the HTML content of a selected element?
- a) `html()`
- b) `text()`
- c) `content()`
- d) `changeHTML()`
- **Answer: a) html()**
**Events in Query**
Q11. How do you attach a click event to a button using jQuery?
- a) `$("button").click(function() {});`
Related CS521 files
All CS521 files →Get more out of VUBuddy, for free
- Unlimited downloads
- The explanation behind every MCQ answer
- Study offline on slow data
- 30 downloads a day instead of 3
- Sign in and buy Pro Semester here
One Pro Semester membership works in both the extension and the app.