I have an ajax script to load json data from server.. and I create a radio button from this data using js.. after that I want to manipulate it with jQuery but I can't.. can you explain me?
This the ajax js..
function cs_mediaJson(link,selector)
{
$.getJSON(link,function(data){
$.each(data,function(i,item){
var openTag = "<div class='col-lg-2'>";
var closeTag = "</div>";
openTag += "<input class='media-radio' id='media-radio' type='radio' name='media-radio[]' value='"+item.id+"'>";
openTag += "<label class='label'><img width='100%' height='100%' src='"+item.post_content+"100x100-"+item.post_title+"'></label>";
openTag += closeTag;
$(selector).append(openTag);
});
});
}
The function of that code is to make radio button from json.. and I want to manipulate the radio button like, if I click it I will get the value and display the value to an input textbox ... please help me guys as I am new to JS