[SCRIPT]-JQUERY PROBLEM ADDING NEW ATTRIBUTE TO FORM ELEMENT

JQUERY PROBLEM ADDING NEW ATTRIBUTE TO FORM ELEMENT

You could use live.

<div id="expenses_input1" style="margin-bottom:4px;" class="clonedInput_expenses">

<input type="text" name="expenses_label1" id="expenses_label_id1" value="Property Taxes" /> 

<input type="text" name="expenses_value1" id="expenses_value_id1" value = "$10,000.00" /> 

<span title="Remove" id="btnDel_expenses" class="del_or_something a_hand" onclick="javascript:remove_this(\'' . $id . '_expenses_input1\');"><img src="../images/delete.png" /></span>

</div>

and then

$(document).ready(function() {
    $('.del_or_something').live('click', function() {
        $(this).parent().remove();
    });
});

I’m not sure if the $.addEvent() should or shouldn’t work in this case, but I would suggest trying the $.live() method instead.

The point of $.live() is that it will apply to things that match your selector, even if they’re added to the page long after you call $.live().

0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments