0

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?


100% portable IDE (that is, works *fully* on a pen drive) & C++ compiler (Windows)

Possible Duplicate:
Portable Programming IDE

(cross-post from /r/programming @ reddit)

It doesn't need to be a full-blown IDE, a compiler would do (though syntax highlighting would be great||something like Sublime Text).

Since I usually only program in Linux, I'd like to try programming with windows.h. (It seems a messy API, though.) I guess the compiler would include it?

If there's no decent compiler/IDE I'll have to go with web programming, but after so much time it's tiring. Thanks a lot!

4

2 に答える 2

4

id を持つ他の要素と同様に:jQuery('#obj1')

または、すべてのオブジェクト要素を取得するには:jQuery('object')

于 2012-10-07T17:11:50.110 に答える
3

jQuery 取得 html」

要素の HTML レンダリングを取得する方法を尋ねているようです。

その場合は、次のようにします。

var markup = $("#obj1")[0].outerHTML;

または使用.prop()

var markup = $("#obj1").prop("outerHTML");

またはjQueryなし:

var markup = document.getElementById("obj1").outerHTML;
于 2012-10-07T17:17:37.780 に答える