The reason your code is not working is because you need to escape your " quotation marks, otherwise it will be interpreted as the HTML attribute symbol.
And I agree with the others, it is a bad practice to write your JavaScript inline inside your HTML.