我有以下代码:
<script type="text/javascript">
function editLabel(source) {
source.innerHTML = '<input type="text" value="' + source.innerHTML + '"/>';
source.onclick = null;
source.children[0].focus()
}
function setLabel(source) {
if (source.children[0].value != '') {
source.onclick = function () { editLabel(source); };
source.innerHTML = source.children[0].value;
}
}
然后在我的asp标签中:
<asp:Label ID="lblName" runat="server" onfocusout="setLabel(this);" onclick="editLabel(this);" Text='<%# Bind("GroupDescription") %>'></asp:Label>
这在 Chrome 和 IE 中运行良好,但在 Firefox 中不起作用。
这是因为 Firefox 只支持 onblur。
我试图将 onblur 添加到标签和文本框,但它不起作用。
我能做什么?
谢谢