Input/button Link Method

Source: Internet
Author: User

I summarized the commonly used Button links. The Code is as follows:

1. Link to a page
<Input type = "button" name = "Submit" value = "Confirm" class = "btn" onclick = "location.href}'filename.html '"/>

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 = "true" class = "btn" onclick = "javascript: Invalid parameter open('filename.html ','', '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: // hi.baidu.com/harryxue' "/>

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: // response); Specify parameter locationparameters '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 ('Are you sure you want to submit? '); Location. href = 'filename.html'; return false; ">
Method 2:
<Input type = "button" name = "submit2" value = "OK" class = "BTN"
Onclick = "If (confirm ('Are you sure you want to submit? ') Location. href = 'filename.html'; return false; ">

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.