Search code examples
htmliframeblazor-client-side

Can Html iframe tag have source from a html encoded text string?


Is it possible for html tag <iframe> to have a src attribute coming from a string of text that containts html tags? If yes, can you please give sample?


Solution

  • I am going to answer my question. This is possible with the use of srcdoc attribute. Thus,

    <iframe srcdoc=""></iframe>