我试图在单击时使 div contentEditable 成为可编辑的,然后在鼠标移出时将 contentEditable 设置为 false,但到目前为止我还没有成功。单击链接似乎会突出显示它,但除此之外什么都不做:
<div id="content" contentEditable="true" onclick = "this.contentEditable = true;" onmouseout = "this.contentEditable = false;">
Surprisingly, <a href="http://google.com">clicking this link does nothing at all.</a> How can I fix this problem?
</div>
Run Code Online (Sandbox Code Playgroud)
我希望该链接在被点击时会将我带到链接页面,但相反,它在点击时被突出显示并且没有做任何其他事情。我该如何解决这个问题?