Hi!
I want to change the onkeyup attribute of a id=“duration” textbox which is buried deep inside the DOM tree. I have a list which is inside a for loop:
var text = '<li><div class="MediaBlock">';
text += '<div><input name="checkboxSelected" type="checkbox" />' + selectedListDesc[i];
text += '<span class="MediaItemDescription"><i>' + selectedList[i];
text += ' <div>Duration: <input type="text" id="duration" name="duration" onkeyup="saveDur(this, ' + i + ')" value="' + selectedListDur[i] + '" /></div>';
text += '</i></span></div><div style="clear: both"></div></li>';
$("#selectedMedia").append(text);
The reason that I have so many div and span is for formatting, which I have cut short here.
and I want to change the onkeyup it here:
$('#selectedMedia').eq(newPosition).find('#dur').attr("onkeyup", "saveDur(this, " + newPosition + ")");
where newPosition is say the 3rd LI of the selecteMedia UL list. But I think the attr onkey up is not changed. Please help. Thanks.