Am trying to pass a argument in jquery html pop up.But am not able
to do so.The below is my code.
var emailid =result.rows[0].emailid;
var html = '<input type="button" class="closebtn" value="close"/>'
+ 'Firstname :'+result.rows[0].firstname+'<br/>'
+ 'Lastname :'+result.rows[0].lastname+'<br/>'
+ 'Emailid :'+result.rows[0].emailid+'<br/>'
+'<input type="button" value="Approve"
onClick="approve('emailid');"/>;
JAVASCRIPT is
function approve(id){
var email=id;
alert(email);
}
-
It says missing something in my variable html.I tried passing like
`onClick="approve(emailid);".`Even it doesnt work.Can you please pointout wat error am doing?
Try this:
The problem was having quotes inside of quotes. You need to escape them with backslashes.
Edit. Or… you probably meant:
Here’s a quick and dirty demo: http://jsfiddle.net/SwhWx/3/