I want to increase the right margin of .questionarea by 400px every time a user clicks on .go. Here's my Javascript.
var marright = "-400px"
$(".go").click(function(){
$(".questionarea").animate({
marginRight: marright
}, 300 );
marright += "-400px";
});
If you take out the second last line, the button works once but I've got no idea of the syntax for increasing the size of the margin on each additional click.
marrightis becoming something like "-400px-400px-400px-400px" (A string). Add the "px" after the arithmetic.