Search code examples
javajqueryjoddjodd-lagarto

Jodd Jerry (java): how to get the contents of node itself?


Using Jodd Jerry, how to get the contents of node itself? (Jodd jerry is Java utilility)

Like jQuery:

$("selector").prop('outerHTML')

Solution

  • String contents = jerry.$("selector").get(0).getHtml();
    Node node = jerry.$("selector").get(0);   
    String html = node.getHtml() 
    

    node has getHmtl()