If your inner HTML uses single ''
quotes use double ""
quotes around. Also, you can directly append HTML in jQuery. There's no need to create an element before using append()
.
$( '#main' ).append( "<object> ... html with single 'quotes' ... </object>" );
In case, you need to have a reference to <object>
element as well use appendTo()
as
var $object = ( "<object> ... </object>" ).appendTo( $( '#main' ) );