Looking for some direction as my jQuery skills are lacking here. What I'm doing is dynamically creating a jQuery.Dialog object from a div tag. I want to get the <div> title attribute and use it as the Dialog's title attribute. How do I go about getting this from this code?
jQuery(function ($) {
$('div[id^="my-dialog_"').dialog({
autoOpen: false,
title: '<h4>' + needCurrentObjectsTitleAttribute + '</h4>',
width: 500,
modal: true
});
$('.my-modal').click(function () {
var target = $(this).attr('id');
$('#' + target + '_content').dialog('open');
return false;
});
});
I thought I'd be able to use
$('div[id^="my-dialog_"').attr('title')
but didn't work as expected. Wish I knew JS/jQuery as well as I know C#