Home >Web Front-end >JS Tutorial >js method to implement a tag hyperlink to submit form_javascript skills

js method to implement a tag hyperlink to submit form_javascript skills

WBOY
WBOYOriginal
2016-05-16 15:53:191795browse

The example in this article describes the method of using js to implement a tag hyperlink to submit a form. Share it with everyone for your reference. The specific implementation method is as follows:

<form action="/home/search" method="get" id="search_form">
<div class="searchBox png" id="searchBox">
<input type="text" id="searchTxt" class="searchTxt"
name="shopName" value="@shopName">
<a class="searchPic h-submitBtn png"
id="h-submitBtn" onclick="document:search_form.submit();">
</a>
</div>
</form>

The a tag here can be written in the following ways:

Method 1:

Copy code The code is as follows:
eed6d2901a87b3b63106a1643252c2ddSubmit5db79b134e9f6b82c0b36e0489ee08ed

Method 2:

Copy code The code is as follows:

Method 3:

Copy code The code is as follows:
ffc81f56e5efb28b1cf948c24cd93eb6Submit5db79b134e9f6b82c0b36e0489ee08ed

I hope this article will be helpful to everyone’s JavaScript programming design.

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