hi am trying to create a new div but using the value from an array for its id
var divID = 'borough_'+BoroughTagger.myIdArray[intIndex];
jQuery('<div/>', {
id: divID
}).appendTo('#results');
doesn't seem to work ? any ideas?
UPDATE:
removed comma from the line id: divID,
<div></div> is now created but no id property is created.
From what ive tried so far the following from joes answer works: $('#results').append('');
ie a div is created : <div id="borough_2"></div>
i am performing an ajax call after creating this div and wish to do:
success: function(data){
// data retrived ok
var myData = data;
$("boroughId=" + BoroughTagger.myIdArray[intIndex]).html(myData)
}
using joes method the div is created but i still cant reference it to append the data recived from the ajax request. is there some scope problem perhaps?
divID. It will break most versions of IE.<div></div>no id is added