好的,我已经这样做了,它看起来很有效:
我首先在我的jquery.jeditable.js中添加了一个新的输入类型
number: {
element : function(settings, original) {
var input = $('<input type="number">');
if (settings.width != 'none') { input.attr('width', settings.width); }
if (settings.height != 'none') { input.attr('height', settings.height); }
/* https://bugzilla.mozilla.org/show_bug.cgi?id=236791 */
//input[0].setAttribute('autocomplete','off');
input.attr('number','off');
$(this).append(input);
return(input);
}
},
然后我在我的 html 页面中创建了脚本:
$('.number').editable(function(value, settings) {
console.log(this);
console.log(value);
console.log(settings);
return(value);
}, {
type : 'number',
style : "inherit"
});
在我的html中
<p class="number" style="text-align: right;">000,00</p>