3

jQuery でdocument.body.innerText;どのように呼び出すかを知る必要があります。document.body.innerHTML;jQueryはdocument.bodyで始まるjavascriptメソッドをどのように処理しますか...

ありがとう

4

5 に答える 5

5
// document.body.innerText;
$('body').text();

.text() ドキュメント

//document.body.innerHTML;
$('body').html();

.html() ドキュメント

于 2012-09-24T19:17:09.063 に答える
4

ここにそれらがあります --text()そしてhtml():

$("body").text()$("body").html()

于 2012-09-24T19:16:45.567 に答える
2

$('body')またはを使用$(document.body)してボディを選択します。次に、 と を使用.text().html()て、関連するコンテンツを取得できます。

于 2012-09-24T19:18:39.483 に答える
1

$("id/class/name/document")選択することであり、html()(innerhtml ) とtext()(innertext ) を使用して内容を確認できます。

1-テキスト()

<div class="demo">Demonstration Box</div>

The code $('.demo').text() would produce the following result:

これは選択することです--^^^^^^^^^^^^^^---クラスの内容へdemo

出力:

 Demonstration Box  

2 -html()

                      <div class="demo"><p>Demonstration Box</p></div>

$("input").html("text"); will change the---^^^^^^^^^^^^^^^^^---to text
于 2012-09-24T19:19:52.853 に答える
0
$('body').text(); // innertext
$('body').html();//innerhtml
于 2012-09-24T19:25:29.923 に答える