I have, for example, the following <object> in my page:
<object id="obj1" data="URL"></object>
Is there any way to get the html object in jquery?
As with any element with an id: jQuery('#obj1')
Or to get all object elements: jQuery('object')
<object> start tag and the </object> end tag, so of course getting an HTML representation of the child nodes of the element will give you a blank result."jQuery get html"
It seems like you're asking how to get the HTML rendering of the element.
If so, do this:
var markup = $("#obj1")[0].outerHTML;
Or using .prop():
var markup = $("#obj1").prop("outerHTML");
Or without jQuery:
var markup = document.getElementById("obj1").outerHTML;
<object>, then it won't find it. Put your code after the element, or run it inside a handler passed to $(document).ready().