$("#@ViewBag.PageGroupID").append(data);
Now ViewBag.PageGroupID
returns the id of the div at runtime.What if i want to append data in the div(the id which i will get runtime).How do i acheive this?
$('#btnPageElementClick').click(function () {
var flag = false;
var b;
$.ajax({ type: 'GET', url: '/ScriptedTestCase/pageElementPV/' + $('#PageElements').val(), data: null,
success: function (data)
{
$("#@ViewBag.PageGroupID").append(data); //where divID is the id of the div you append the data.
}
});
return false;
});