how to insert custom title on my simple widget using append method?
Hello guys i have a pretty standard div with css and i would like to append to a div that already exists with a given class. here is my mark up
<div id ="one" class="PortalBox"> </div> <div class="ab_Box1d"> <div style="width:600px;"> <%@ include file="./concur-reports/index.html"%> </div> </div> <!--finish ab_box1d--> </div>
so basically I'm trying to append the markup in jquery when i stumble upon any div with class "PortalBox" however i need to make a part dynamic which would basically be a title this part
'<td style="text-align:left">my channel</td>'+
- $(document).ready(function() {
-
- $('<div class="ab_Box1a" id="report1" style="width:640px; padding-top:6px;">'+
- '<div class="ab_Box1b" id="reportchild1"> </div>' +
- '<table class="ab_Box1c" width="100%" border="0"'+
- 'cellspacing="0" cellpadding="0">'+
- '<tr>'+
- '<td style="text-align:left">'+ $(this).data('title')+'</td>'+
- '</tr>'+
- '</table>'+'</div>').appendTo('div.PortalBox');
-
-
- })
need to be dynamic to pick up the title from another HTML attribute withing the div. can i add a "title" attribute or any other attribute for that matter i dont really care. so that i can give my simple widget a title based on the attribute?