So, I have jquery spitting out containers with h4’s inside. Each of these containers contains a “remove” button. When you click this remove button you get a jquery UI dialog confirm prompt. This prompt basically says:
Are you sure you wish to remove ((Contents of H4 tag)) ?
Here is the html…
<div class="container"> <h4>Title of Item</h4> <div class="remove">Remove</div> </div> <div class="remove-dialog"> Do you wish to <strong>remove the <span class="account-name">((Account Type))</span></strong> account fromyour application?
**Here is my jQuery**
// Remove Added Account and Subtract from Account count
$('.remove').live('click',function() {
var current = this
var AccountName = $(this).closest('div').children('h4')
console.log(AccountName)
$(".remove-dialog").dialog({
buttons : {
"Yes" : function() {
$(this).dialog("close");
$(current).parents("div:first").remove()
Accounts--
$('.account-count').val(Accounts).change()
},
"No" : function() {
$(this).dialog("close");
}
}
});
$('.remove-dialog').dialog("open");
});
So what I want is to populate the ((Account Type)) with the h4 in the same container. Thanks in advance for any help.
something like this?
it’s this line that gets you to the title:
this line sets the text: