I have a dynamically generated webpage through javascript, when I try to get html code of it using $("html").html(). I get everything, and it is fine. The only problem is for the empty tags such as <link />, <input />, <img />, <br />
are not displayed as I want.
I want them to be displayed in properly closed format as below -
<input type="text" name="nm" />
but they are getting displayed as
<input type="text" name="nm">
i.e. no closing
I want to create an html object in java of this string but I get an exception like invalid html.
Any solution ?