I am having trouble with adding the buttonClassvariable into the class attribute. How can I escape the double and single quotes here?
String buttonClass= changed ? "changeButton" : "dontChangeButton";
button.append("<input id='" + id + "' type='button' value='" + buttonValue + "' class='" + buttonClass
+ "' ui-button ui-widget' />");
You can use backslash for escaping character, or post the string on this website and let it do the work for you: http://www.freeformatter.com/java-dotnet-escape.html