$.get('index.html'), function(data){
console.log(data);
});
在控制台日志中,它打印出 index.html
中的所有内容.但是如何只打印出<div id="description">Lorem ipsum</div>
中的内容呢?里面data
?
谢谢!
最佳答案
$.get('index.html'), function(data){
console.log($("#description",data).text();
});
关于javascript - 获取数据对象内的 div 内的内容,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25044124/