Front-end dot

Preface:
Preface to record some easy to forget when writing interface ideas. (I will continue to add)

HTML attribute in target

Use the target attribute, you can define the linked document is displayed where.

  1. "_Blank": click to open a new window into the destination document
  2. "_Parent": makes the document into the parent window or frameset that contains hyperlinks to referenced frame. If the reference is in a window or in the top frame, then it is equivalent to the target _self.
  3. "_Self": not all targeting <a>tag is the default destination, so that the target document is loaded and displayed as the source document in the same frame or window. The goal is redundant and unnecessary, unless the document title and <base>used with the target attribute tag.
  4. "_Top": makes the loading of the document that contains the hyperlink window, _top target will erase all the frames and loaded the entire document is contained in the browser window.

When you use the most "_blank" instead of the default declaration is "_self". Not only, you can <a>use the label, the other is also possible to use, such as the following:

<form name="search" action="#" th:action="@{/search}" method="post"
						target="_blank">
						<div class="ui icon inverted transparent input m-margin-tb-tiny">
							<input type="text" name="query" placeholder="Search...."
								th:value="${query}"> <i
								onclick="document.forms['search'].submit()"
								class="search link icon"></i>
						</div>
</form>

This is what I used when writing springboot project, when will open a new window click on the search results page to open the search.

How easy was done after a click on any tab in the form will submit results

<form name="search" action="#" th:action="@{/search}" method="post"
						target="_blank">
						<div class="ui icon inverted transparent input m-margin-tb-tiny">
							<input type="text" name="query" placeholder="Search...."
								th:value="${query}"> <i
								onclick="document.forms['search'].submit()"
								class="search link icon"></i>
						</div>
</form>

Or this code, this code <i>has the effect of the label must submit click, click function so declared:

onclick="document.forms['search'].submit()"

Note that the representative form of the name attribute search forms [ 'search'] in.
Effect:
Here Insert Picture Descriptionit will appear in the search results you want to click on the question mark.

Published 17 original articles · won praise 21 · views 681

Guess you like

Origin blog.csdn.net/CodingNO1/article/details/104555188