2
function abc(id, name){
   var button = '<img src="/images/abc.png" onclick="getvalue('+id+','+name+')"/>';
   $('Div1').set('html',button);
}

my this code is not working. it gives an error. The error is: suppose value of name is Gaurav. then it gives error Gaurav is not defined. Please help me and tell me where is error.

1 Answer 1

1

Use the following code:

var button = '<img src="/images/abc.png" onclick="getvalue('+id+',\''+name+'\')"/>';

and i am sure, the error will not come.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.