Main Content

getHTMLText

Get contents of HTML Viewer tab

Since R2025a

    Description

    htmlText = getHTMLText(V) returns the HTML contents of the specified HTML Viewer tab as a string.

    example

    Examples

    collapse all

    Display a page with the text "Hello World" in an HTML Viewer tab by using the web function.

    [stat,h] = web("text://<html><h1>Hello World</h1></html>");

    Then display the HTML contents of the page.

    htmlText = getHTMLText(h)
    htmlText = 
    
        "<html><head><link type="text/css" rel="stylesheet" id="HTMLViewer_ThemeLink" ....
                         ::selection {
                             background: #1656a7cc; /* cc for 80% alpha */
                             color: #fff;
                         }
                         .ActiveSelection {
                             background-color: #616161cc;
                             color: #fff;
                         }
                         .PassiveSelection {
                             background-color: #fff5bccc;
                             color: inherit;
                         }
                     </style><h1>Hello World</h1></body></html>"

    Input Arguments

    collapse all

    HTML Viewer tab, specified as amatlab.htmlviewer.HTMLViewer.

    Output Arguments

    collapse all

    HTML contents, returned as a string scalar.

    Version History

    Introduced in R2025a

    See Also

    Functions

    Classes