Ask a Question
Ask Question Login
Corporate Training
  1. Community
  2. Web-development
  3. Question
Web-development

Set background image to a div in LWC

Asked by Connor Peake Aug 1, 2021 2.4K views 1 answer
Share

About this question

I am findiing Divs dynamically in my LWC component using data-id and that works. But when i am trying to set background image, it says.cannot read of property style of undefined. here is my code:
wiredResult({ error, data }) { if (data) { this.result=data; for(var i=0;i

any hrlp wil be appreciated. How javascript set background image?

 

Your answer

1 Answer

More Web-development discussions

Learn & Explore

Free tutorials and interview questions from industry experts — learn the skill, then get ready to prove it.

Latest from the JanBask Blog

Guides, tips and career advice from JanBask experts.