1: If you use the tag <a> to link to a page, I believe everyone knows the role of the target attribute. It refers to the form of the linked page. Commonly used values of target include: _blank (the page that opens the link with a new pop-up browser window), _self (the page that opens the link in the original window). Of course, there are _top, etc., because they are not commonly used, so I won’t introduce it here.
For example: <a href=http://VeVb.com target=_blank>Wulin.com</a> means you want to link to Wulin.com and open it with a new window.
2: If you use the tag <a> to trigger an action (after the action is completed, you usually have to jump to a certain page). This action can be divided into two types here:
(1) Actions in the form form are not submitted (i.e. actions that do not operate on form). Related scenarios in web development, such as: deleting a record individually, etc., such operations are not very complicated, and there are not many parameters required, and they are all submitted in the get method. At this time, you can specify the display form of the page to be redirected through the target attribute. The usage here is the same as that described in 1.
for example
<a href=http://VeVb.com/user/deleteAction.do?id=5 target=_self>Delete Xiao Ming</a> means that after processing the action, a new page is still opened in this window.
(2) Actions submitted in the form (that is, actions to submit data in the form). Such applications in web development are often registered with users, modified information, etc. Of course, some people may say that the data in the form can be submitted directly using <input type=submit> or <input type=button>. But in some cases, you may prefer to submit it in the form of <a href=javasrcipt: your js function name>. If you submit it here in the form of a tag <a>, and you want to use the attribute target to control the page you want to jump after the processing is completed, it won't work. At this time, the target attribute is no longer working. Instead, you should formulate it in the form target attribute so that it will be as you wish!
for example:
Copy the code