Input link page open a new page and so on

  • 2020-03-30 01:12:07
  • OfStack

1. Link to a page

< Input type="button" name="Submit" value=" confirm "class=" BTN"

Onclick = "location. The href = 'filename. HTML'" / >

2. Back (equivalent to back)

< Input name = "Submit2" type = "button" class = "BTN"

Onclick = "location. The href = 'javascript: history. Go (1); '" value=" return "/>

3. Open a new page

< Input type="button" name="Submit2" value=" class=" BTN"

The onclick = "window. The open (filename. HTML ')" / >

Open a new window with no borders

< Input type="button" name="Submit2" value=" sure "class=" BTN" onclick="javascript:window.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=" confirm "class=" BTN" onclick="window.open('filename.html'); The location. The href = 'http://www.cxybl.com' "/ >

6. Open a new window without borders and point to another page

< Input type="button" name="Submit2" value=" sure "class=" BTN" onclick="javascript:window.open('http://www.cxybl.com',','width=720,height=500,resizable=yes,scrollbars=yes,status=no'); Window. The location = 'filename. HTML';" / >

7. Click the button to pop up the confirmation alert window

A:
< Input type="button" name="Submit1" value=" ok "class=" BTN"
OnClick ="alert(' confirm commit? '); The location. The href = 'filename. HTML; Return false;" >
Method 2:
< Input type="button" name="Submit2" value=" ok "class=" BTN"
OnClick ="if (confirm(' confirm to submit? ')) location. Href = filename. HTML '; Return false;" >

Related articles: