I am trying to create a clickable link in javascript
var content = '<a href=\"#\" onclick=\"displayContent(\"TEST\")\">Whatever</a>';
$("#placeHolder").html(content);
but I keep getting an error
Uncaught SyntaxError: Unexpected token }
Is that not the correct way to escape double quotes and create a link?
You only need to escape the single quotes
As bozdoz says:
But why not do
Or as Nathan says: