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 B2B Commerce Developer Topic 1 Question 41 Discussion

Actual exam question for Salesforce's B2B Commerce Developer exam
Question #: 41
Topic #: 1
[All B2B Commerce Developer Questions]

A developer used slots to pass content from one Lightning Web Component to another. How can they access the.

DOM for what was passed to those slots?

Show Suggested Answer Hide Answer
Suggested Answer: B, D, E

Contribute your Thoughts:

Walker
1 months ago
I bet the answer is to use a magic wand and yell 'Accio DOM!' That'll surely work, right?
upvoted 0 times
Kiera
19 hours ago
D) Call this.template.querySelector() passing an id
upvoted 0 times
...
Van
9 days ago
C) Call this.querySelector() and this.querySelectorAll()
upvoted 0 times
...
Dino
1 months ago
A) Call this.template.querySelector() and this.template.querySelectorAll()
upvoted 0 times
...
...
Twana
2 months ago
Option D seems a bit too specific with the id, I'll stick with the more generic this.template.querySelector().
upvoted 0 times
Shaunna
8 days ago
User4: Sounds good, let's use that to access the DOM.
upvoted 0 times
...
Adelaide
1 months ago
User3: I agree, let's stick with this.template.querySelector().
upvoted 0 times
...
Graciela
1 months ago
User2: Yeah, that seems like the right way to go.
upvoted 0 times
...
Marya
1 months ago
User1: I think we can access the DOM using this.template.querySelector()
upvoted 0 times
...
...
Tamra
2 months ago
I think option C is the way to go - using this.querySelector() and this.querySelectorAll() should do the trick.
upvoted 0 times
Luann
1 months ago
User 2: Yeah, using this.querySelector() and this.querySelectorAll() should work.
upvoted 0 times
...
Nguyet
1 months ago
User 1: I think option C is the way to go.
upvoted 0 times
...
...
Rolande
2 months ago
Hmm, I wonder if passing an id to this.querySelector() in option B would work. Guess I'll give it a shot!
upvoted 0 times
...
Ashton
2 months ago
Option A looks promising, I'll try using this.template.querySelector() and this.template.querySelectorAll().
upvoted 0 times
Donette
17 days ago
Let's give it a try and see if we can access the DOM successfully with this method.
upvoted 0 times
...
Lavonda
28 days ago
I've used this.template.querySelector() before and it worked well for me. It's a good choice.
upvoted 0 times
...
Rossana
1 months ago
Yes, I agree. It's the correct way to access the DOM for the content passed through slots.
upvoted 0 times
...
Latia
1 months ago
I think A is the way to go, using this.template.querySelector() and this.template.querySelectorAll() will help access the DOM.
upvoted 0 times
...
...
Kent
2 months ago
I'm not sure, but I think it might be D) Call this.template.querySelector() passing an id.
upvoted 0 times
...
Alberto
2 months ago
I agree with Beatriz, because this.template is used to access the DOM of the component.
upvoted 0 times
...
Beatriz
2 months ago
I think the answer is A) Call this.template.querySelector() and this.template.querySelectorAll().
upvoted 0 times
...

Save Cancel