HTML SELECT control not selecting correct value

I have noticed that when I select a table row , getting the id, popping a div with a form all of my fields are being populated with the correct values except the ‘subcategory_id’ element (select). The data is there in the control but it is not selecting. and I am not sure why. If I had to guess it would be because the values in the control were added via jquery but are not visible in the source. How do I resolve this.

I am selecting a table row link and getting a json array returned:

{“id”:“1844”,“title”:“Test 2”,“keywords”:“james, aaron, purple, orange”,“media_id”:“1”,“category_id”:“17”,“subcategory_id”:“28”,“description”:“This is some test data”}

and callback to:

function editCatalogue(id) {
		   var dataString = 'id='+id;
			  function(returnData) {
				data = jQuery.parseJSON(returnData);
				catid = data['category_id'];
				$.each(data, function(key , value) {

Some of the subcategory values returned from php:

<option>Please Select</option><option value=“33”>Access Floors</option><option value=“34”>Balustrades</option><option value=“29”>Doors: general</option><option value=“28”>Doors: industrial</option><option value=“30”>Doors: parts, accessories</option><option value=“25”>External & entrance screens</option><option value=“31”>Lintels, sills, weather bars, other</option><option value=“36”>Rooflights</option><option value=“32”>Room dividers, internal grilles etc.</option>

Subcategory values passed to the html control:

	function getSubcategory(id) {
        var dataString = 'catid='+id;
        $.ajax ({
          type: "POST",
          url: "php/subcategory_by_categoryid.php",
          data: dataString,
          cache: false,
          success: function(data) {

Have I provided the incorrect information here for assistance,

Ok I just resolved this. I didnt try to do it in jquery, I just added the ‘selected’ attribute to the php output, not sure why I didn’t think of this earlier.