Add link, forward, backward, and other functions to Button/input

Source: Internet
Author: User

Add link, forward, backward, and other functions to Button/input. When you look at the title, you should understand what is going on. We use the most A-level link in daily webpage creation, some of my friends may have never used to add links to buttons. Today, the fireworks editor adds links related to buttons and inputs to move forward and backward, the pop-up confirmation alert window and other code are sorted out, hoping to help you.

The Code is as follows:

Copy to ClipboardReference: [www.bkjia.com] 1. Link to a page
<Input type = "button" name = "Submit" value = "Confirm" class = "btn" onclick = "location. href = 'HTTP: // www.bkjia.com/down'"/>

2. Return (equivalent to back)
<Input name = "Submit2" type = "button" class = "btn" onclick = "location. href = 'javascript: history. go (-1); '"value =" return "/>

3. Open a new webpage
<Input type = "button" name = "Submit2" value = "Confirm" class = "btn" onclick = "Define Your open('filename.html ')"/>

4. open a new window without Borders
<Input type = "button" name = "Submit2" value = "Confirm" class = "btn" onclick = "javascript: window. open ('HTTP: // bbs.bkjia.com ', '', 'width = 720, height = 500, resizable = yes, scrollbars = yes, status = no')"/>

5. Open a new page and point to another page
<Input type = "button" name = "Submit2" value = "" class = "btn" onclick = "window.open('filename.html '); location. href = 'HTTP: // www.liehuo.org '"/>

6. open a new window without borders and point to another page
<Input type = "button" name = "Submit2" value = "Confirm" class = "btn" onclick = "javascript: window. open ('HTTP: // www.liehuo.org ', '', 'width = 720, height = 500, resizable = yes, scrollbars = yes, status = no'); registry.location='filename.html '; "/>

7. click the button to bring up the confirmation alert window.
Method 1:
<Input type = "button" name = "Submit1" value = "OK" class = "btn"
OnClick = "alert ('liehuo _ net prompt: submitted successfully! '); Location. href = 'filename.html'; return false; ">
Method 2:
<Input type = "button" name = "Submit2" value = "OK" class = "btn"
OnClick = "if (confirm ('fire school tips: Are you sure you want to submit? ') Location. href = 'filename.html'; return false; ">

Thank you for your support for the fire school. Thank you for your valuable comments!

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.