Jquery contenteditable=";“真的”;不处理按钮元素

Jquery contenteditable=";“真的”;不处理按钮元素,jquery,html,Jquery,Html,我有下面的按钮 <button data-shq-name="Submit Button" data-shq-id="submit-text" type="submit" data-shq-type="editable-text" class="btn">Get Instant Access</button> 请提供任何帮助。此代码在“chrome浏览器”中工作 <button type="button" contenteditable="true

我有下面的按钮

<button data-shq-name="Submit Button" data-shq-id="submit-text" type="submit" data-shq-type="editable-text" class="btn">Get Instant Access</button>

请提供任何帮助。

此代码在“chrome浏览器”中工作

        <button type="button" contenteditable="true">
            A button
        </button>
--


button元素究竟如何可编辑?这必须是针对div元素的。我想编辑按钮的文本。例如,我想使用content editable true更改以下按钮中的“Get Instant Access”。请尝试设置DOM属性而不是HTML属性:
this.contentEditable=true
$(this).prop(“contentEditable”,true)。将属性设置为字符串
“true”
也可能起作用:
$(this.attr(“contenteditable”,“true”)
@Yunus您可以为此使用
.val()
.text()
。我已经添加了event.preventDefault,但它不起作用。。此外,该属性不能像上面代码中那样出现在按钮中。您在哪个浏览器上?我的
Chrome
即使通过
JQuery
添加属性,也能正常工作。尝试在回调@Salathiel Genese的末尾添加
return false
,我正在FF、Chrome、Safari中尝试。。目前,我在代码中默认添加了contenteditable=“true”。。稍后,如果我找到其他方法,我将改变这一点。谢谢..找到了
返回false的解决方案了吗
        <button type="button" contenteditable="true">
            A button
        </button>
    <form method="POST" action="#">
        <button type="submit" contenteditable="true">
            A button
        </button>
    </form>
     $(function() {
        $('button').click(function(event) {
            event.preventDefault();
        });
    });