get the id from dinamic control
hi all ,
i got a problem and i want a help..
im using JQUERY to create dinamicaly controls checkbox , but i dont know how i can get de IDs from this checkbox to use this parameter..
anybody help ? ;/
this is my markup code .
<%-- in this function i create the checkbox dinamicaly and put a CSS style to the next label beside the checkbox --%>
$(document).ready(function() {
$('#btnIncluir').click(function() {
var variavelEmail = $('#txtEmail').val();
var variavel = $('#txtContato').val();
$('#Label1').append('<input type="checkbox" onclick="$(this).next().css(\'color\', \'red\');" />', '<span>' + variavel + " " + " " + "<" + " " + variavelEmail + " " + ">" + '</span><br/>');
});
});
<%-- in this function i get the variable and put the value in a other label --%>
$(document).ready(function() {
$(':input').click(function() {
if (this.checked)
{
var variavel = $(this).next().text();
$('#legal').append(variavel);
}
});
});