I am trying to pass two arguments in the on click javascript function. I need to enclose the the arguments in quotes. when i enclose it in single quotes it breaks the quote that starts from image and when i use double it breaks the quotes in front of javascript. how do i enclose it that it doesn't break my code?
$("#Div").append('<img id ="myImage" src ="/images/myimage.png" onclick="javascript:myfunction('addnew',$("#field").val())"/> Error.')