如何在contentEditable div中制作可点击的锚点? [英] How to make clickable anchor in contentEditable div?

查看:95
本文介绍了如何在contentEditable div中制作可点击的锚点?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下代码:

I have following code:

<div contentEditable="true">
    Blah blah <a href="http://google.com">Google</a> Blah blah
</div>

小提琴

有没有办法让这个 a 可点击,不可编辑,而不需要在该div之外移动锚点?

Is there a way to make this a clickable, not editable, without moving anchor outside that div?

推荐答案

<div contentEditable="true">

    <div contentEditable="false">
            Bla bla <a href="http://google.com">Google</a> Bla bla
    </div>
</div>​

这篇关于如何在contentEditable div中制作可点击的锚点?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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