使用 data-id 复制 TinyMCE 的内容

Copy content of TinyMCE using data-id

我有一个 TinyMCE 的 Wordpress UserFrontend Pro 实现,其中 html 是:

<body id="tinymce" class="mce-content-body post_content_442 post-type-page post-status-publish page-template-default locale-en-us mceContentBody webkit wp-editor html5-captions" data-id="post_content_442" contenteditable="true"><p>The text that I want to copy</p></body>

我正在尝试复制里面的内容ie:

<p>The text that I want to copy</p>

在这种情况下。

我尝试使用

$('[data-id="post_content_442"]')

但这会打印出整个 HTML 本身。

如何只打印输入的 html 格式的文本?谢谢。

$('[data-id="post_content_442"] p').text();

问题是输入位于 ID 为 post_content_442_ifr 的 iframe 中。所以

$jq2("#post_content_442_ifr").contents().find("#tinymce").html();

允许我 select 所需的文本。

谢谢。