Jump to content

JavaScript and BUTTON


AndieB

Recommended Posts

Hi all GURUs!


I would like to create a BUTTON with the <button></button> HTML code.
In this <button> I'd like to add onClick function with the Javascript function to load a new page. I do not want to use the <A HREF> functionality.

I think it would look something like this:
[code]<button onClick="javascript:[b]the code I don't know[/b]" >click here to go on</button>[/code]

What is the [b]javascript code[/b] I'm after?

Thank you all in advance for any kind of help!

--Andreas
Link to comment
Share on other sites

Hi,

maybe try to do something like:

<button onClick="javascript:testing()" >click here to go on</button>

& the javascript part could be:
[code]
function testing()
{
window.open("your_page.html","the_page","width=310,height=400,left=320,top=0");
}
[/code]
hoping it helps,

l8tr,,
Link to comment
Share on other sites

  • 2 weeks later...
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.