Home  >  Article  >  Web Front-end  >  Detailed examples of how HTML can achieve free switching between files

Detailed examples of how HTML can achieve free switching between files

零到壹度
零到壹度Original
2018-03-31 15:10:332386browse

This article mainly shares with you examples of how HTML can achieve free switching between files. Friends who need it can take a look.

The code is very simple (from simplicity to simplicity).

Create a file first. The name of the file can be arbitrary, but the name of the second file cannot be arbitrary, because the second file will be called at that time.

After creating the first file, open the file with Notepad and add the code ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓ (remember to change the file suffix)

<script>
 function jump(){
  document.location="jump.html";
  }
  </script>
  <input type="button" value="jump" onclick="jump()" />

The next step is the second file. The file name I gave here is jump.html

Please remember if you want to change it. Also change the code in the first file to

which is the code of the first file -----------》》》》》》document. location="jump.html";

jump.html can be changed to the file name you created.


##Then there is the code ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓ (remember to change the file suffix Name)

<input type="text" value="Hello Woeld" />

Just put these two files in the same folder.

Double-click the first file, and ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓


Click the button (jump)

to transfer to another file


This completes the switching between files, hurry up and practice it!

The above is the detailed content of Detailed examples of how HTML can achieve free switching between files. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn