我在文本框上定义了一个Onchange事件,如下所示
$('input[ComponentAttribute]').on("change",function () {
dataTxt = "";
var thisID = $(this).attr('id');
var temp = $('#' + thisID).val();
if (!(temp.trim()=='')) {
// alert($(this).attr('ComponentAttributeID') + " - " + temp);
placeholder[$(this).attr('ComponentAttributeID')] = temp;
for (var key in placeholder) {
if (key === 'length' || !placeholder.hasOwnProperty(key)) continue;
var value = placeholder[key];
dataTxt += key + ":" + value + ";";
}
$('[DataAttributeValue]').text(dataTxt);
}
});