Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #111893

    I need to use a window to show some text.

    The text is produced dynamically and then I can’t create it as static html text.

    I tried using innerText and it works.

    However, sometimes, when the text should contain a cr/lf in order to be better formatted.

    I tried with <br/> and with /r/n but none worked.

    How can I do that ?

    Tks

    #111904
    Markov
    Keymaster

    Hi,

    To put HTML instead of Text, you need to use innerHTML, not innerText.

    Regards,
    Markov

    Smart UI Team
    https://www.htmlelements.com/

    #111912

    Sorry but it doesn’t seem to work.

    With the following js code the window appears empty with any message I can use (also “Bye”).

    const window = document.createElement(“smart-dialog-window”);
    window.innerHTML= message;

    #111916
    Markov
    Keymaster

    If you need to dynamically update the content of a window, you should use the updateContent method.

    Regards,
    Markov

    Smart UI Team
    https://www.htmlelements.com/

    #111918

    It works but the HTML is still not understood and <br/> is not interpreted as carriage return.

    Tks

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.