如何删除 Pagedown 编辑器的内容?

发布于 2024-12-20 10:05:22 字数 377 浏览 1 评论 0原文

我什至不确定这是否可能,我正在使用优秀的 Pagedown 编辑器(在本网站上使用)。通常我的文本位于文本区域中......

<textarea name="Description">

</textarea>

并且我的控制器类毫无问题地选择了它。但是因为我使用的是 PageDown,所以我必须使用 div...

<div class="wmd-preview" id="wmd-preview" name="Description">

</div>

如何让我的控制器将此 Html 块的 InnerText 映射到我的描述?我想保留标记太明显了:-)

I'm not even sure if this is possible, I am using the excellent Pagedown editor (used on this site). Usually my text is in an textarea...

<textarea name="Description">

</textarea>

And my controller class picks this up without a problem. But because I'm using PageDown I have to use a div...

<div class="wmd-preview" id="wmd-preview" name="Description">

</div>

How do I get my controller to map the InnerText of this Html block to my description? And I wants to keep the markup too obviously :-)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

时光与爱终年不遇 2024-12-27 10:05:22

如果我理解你的问题,并且你正在使用 jQuery,你可以这样做吗?

$('textarea[name="Description"]').html($('#wmd-preview').html());

If I understand your question, and you're using jQuery could you do this?

$('textarea[name="Description"]').html($('#wmd-preview').html());
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文