• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Javascript within Javascript question


Active member
I created a form which I placed in a .js file. The form works fine, but I need to redirect users to another page once the submit button is clicked.

<input type="button" onClick="document.location.href='http://www.google.com'" />
as you can imagine, the two slashes comment out whatever comes next.

My question is, how do I enter the url so that it isn't commented out?


p.s. this forum has grown quite a bit, I'm not sure if this is the right section. Feel free to move this thread if necessary.