I am writing a code for kendo UI mobile in which i want to show a particular div on check on of check box for this i am writing a function as follows
function showDetails(){
// debugger;
var data = $("#vehicleLoan").attr('checked');
// alert(data);
if(data)
{
$("#Loan").removeAttr("style","display:block");
}
else
{
$("#Loan").removeAttr("style","display:none");
}
}
but i am getting an undefined at data.
Can you try using,
var data = $("#vehicleLoan").is(':checked');
OR
function showDetails(){
$("#Loan").toggle();
}
OR
function showDetails(){
// debugger;
var data = $("#vehicleLoan").is(':checked');
// alert(data);
if(data)
{
$("#Loan").show();
}
else
{
$("#Loan").hide();
}
}
try something like this
if(document.getElementById("vehicleLoan").checked)
{
$("#Loan").removeAttr("style","display:block");
}
else
{
$("#Loan").removeAttr("style","display:none");
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.