Deal of The Day! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Salesforce Exam Javascript Developer I Topic 3 Question 88 Discussion

Actual exam question for Salesforce's Javascript Developer I exam
Question #: 88
Topic #: 3
[All Javascript Developer I Questions]

Given HTML below:

UniversalContainer

Applied Shipping

Burlington Textiles

Which statement adds the priority = account CSS class to the universal Containers row ?

Show Suggested Answer Hide Answer
Suggested Answer: A

Contribute your Thoughts:

Salena
2 months ago
I almost got tripped up by option A, but then I realized that the classes property is not a method, so you can't use push() on it. These questions really make you think!
upvoted 0 times
...
Yoko
2 months ago
Ha! Option D is just plain silly. You can't use querySelectorAll() to add a class to a single element. I'm glad I didn't fall for that one.
upvoted 0 times
...
Sage
2 months ago
Wow, these questions are getting trickier. I almost went with option B, but then I remembered that it's getElementById, not queryElementById.
upvoted 0 times
Ruby
11 days ago
I know, it's easy to mix up those methods. Good thing you caught that!
upvoted 0 times
...
Vivan
14 days ago
C) Document .querySelector('#row-uc').classList.add('priority-account');
upvoted 0 times
...
Oneida
16 days ago
A) Document .querySelector('#row-uc').classList.add('priority-account');
upvoted 0 times
...
...
Jacqueline
2 months ago
Option C is the correct answer. The querySelector() method selects the first element that matches the specified CSS selector, and the classList.add() method adds the specified CSS class to the element.
upvoted 0 times
Nell
18 days ago
You're welcome! It's important to understand how to manipulate classes in HTML.
upvoted 0 times
...
Mammie
20 days ago
That makes sense, thanks for the explanation!
upvoted 0 times
...
Franklyn
1 months ago
C) Document .querySelector('#row-uc').classList.add('priority-account');
upvoted 0 times
...
...
Dino
3 months ago
I'm not sure, but I think D is incorrect because querySelectorAll returns a NodeList, not a single element.
upvoted 0 times
...
Leonard
3 months ago
I agree with Margarita. C seems like the correct option based on the syntax.
upvoted 0 times
...
Margarita
3 months ago
I think the answer is C because classList.add is used to add a class to an element.
upvoted 0 times
...

Save Cancel