如何将html对象转换为字符串类型? [英] How to convert the html object to string type?

查看:122
本文介绍了如何将html对象转换为字符串类型?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用jQuery方法获取某种类型的html对象:

I use jQuery method to get some type of html object:

var content = $('#cke_ckeditor iframe').contents().find('.cke_show_borders').clone();

然后我要将其转换为 string 类型:

Then I want to convert it to string type:

console.log(content[0].toString());

但是结果是:

[object HTMLBodyElement]

如何将其转换为真实字符串?

How can I turn it into real string?

顺便问一下,我可以将转换后的html字符串转换为html对象吗?

By the way, can I turn the converted html string to the html object?

推荐答案

我相信您想使用 console.log(content.outerHTML)

这篇关于如何将html对象转换为字符串类型?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆