Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/django/19.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 这个方法的jQuery等价物是什么_Javascript_Jquery - Fatal编程技术网

Javascript 这个方法的jQuery等价物是什么

Javascript 这个方法的jQuery等价物是什么,javascript,jquery,Javascript,Jquery,我需要知道如何调用document.body.innerText和document.body.innerHTML。jQuery如何处理以document.body开头的javascript方法 谢谢给您,还有: $(“body”).text()和$(“body”).html() 使用$(“正文”)或$(document.body)选择正文。然后,您可以使用.text()和.html()获取相关内容。$(“id/class/name/document”)用于选择,您可以使用html()(inne

我需要知道如何调用
document.body.innerText
document.body.innerHTML。jQuery如何处理以document.body开头的javascript方法

谢谢

给您,还有:

$(“body”).text()和
$(“body”).html()

使用
$(“正文”)
$(document.body)
选择正文。然后,您可以使用
.text()
.html()
获取相关内容。

$(“id/class/name/document”)
用于选择,您可以使用
html()
(innerhtml )和
text()
(innertext )要有内容

1-

2-

演示框

$(“输入”).html(“文本”);将把--^^^^^^^^^^^^^^^更改为文本
document.body==$(body)窗口怎么样。something@Mike:那评论看起来完全错了。首先,没有一个DOM元素是
=$(…)
。则未定义
正文
。它是
'body'
文档。body
@Mike:嗯,
窗口。有些东西
窗口。有些东西
,在jQuery中没有必要,因为jQuery有助于操作DOM元素,但不是为处理对象而发明的。它应该是
$(窗口)
,而且因为窗口有一个onload属性,所以您可以执行
$(window.load(function(){//window has loaded})
#=id#div1.=class.bigButtons和选择任何标记的标记文本这些选择器与CSS相同
// document.body.innerText;
$('body').text();
//document.body.innerHTML;
$('body').html();
<div class="demo">Demonstration Box</div>

The code $('.demo').text() would produce the following result:
 Demonstration Box  
                      <div class="demo"><p>Demonstration Box</p></div>

$("input").html("text"); will change the---^^^^^^^^^^^^^^^^^---to text
$('body').text(); // innertext
$('body').html();//innerhtml