The issue is due to the mis-matched quotes wrapping both the onclick attribute and the window.location assignment. You need to use escaped single quotes within the window.location assignment, and also escape the slashes. Try this: