0
          <div
            className={classes.htmlAnswer}
            dangerouslySetInnerHTML={{ __html: faq.html_answer }}
            style={{
              a:{
                textDecoration:'none',
                color:'gold',
              }
            }}
          />

I am using Material UI and React JS.

Inside of the dangerouslySetInnerHTML, I want every anchor element that appears to receive the styling. How can I do this? The code above doesn't work.

  • You'll either need to use CSS via a ` – cbr Aug 12 '21 at 22:02
  • you can use this library rather use dangerousHtml https://www.npmjs.com/package/interweave – SaimumIslam27 Aug 14 '21 at 07:28

0 Answers0