If I have the below code, textboxes of class serial will be bound to the events more than once if the new serial button is pressed multiple times.
Will this hinder
Well i think this causes a lot of overhead and some problems because the events are binded more than once. Look at this simple fiddle: http://jsfiddle.net/nicolapeluchetti/syvDu/
Serial
Serial
Serial
MonitorSerialTextBoxes();
$('#newSerial').click(function() {
MonitorSerialTextBoxes();
});
function MonitorSerialTextBoxes() {
$('.serial').each(function() {
// Look for changes in the value
$(this).bind("click", function(event) {
alert("hi");
});
});
}
When you load the page a single alòert is displayed when you click on a div, but each time you press the button one more alert is displayed because a new event is attached