Home Web Front-end JS Tutorial How to implement reset function in JavaScript

How to implement reset function in JavaScript

Nov 09, 2021 pm 03:37 PM
javascript reset

JavaScript method to implement the reset function: [$(document).on('click','.dealFlowSelectedBox_bntBox_left',function(){ $('.dealFlowSelectedBox_...].

How to implement reset function in JavaScript

The operating environment of this article: windows10 system, JavaScript 1.8.5, thinkpad t480 computer.

The specific code for JavaScript to implement the reset function is as follows:

HTML code:

<body>
<!--头部-->
<div class="mui-content">
	<div class="headerBox">
		<a href="javascript:history.go(-1);" class="fanhuiBnt">
			<img src="../img/dealFlow/fanhui.png" />
		</a>
		筛选条件
	</div>
	<div class="dealFlowSelectedBox">
		<div class="dealFlowSelectedBox_title">
			<em></em>
			<span>支付方式</span>
		</div>
		<div class="dealFlowSelectedBox_contBox">
			<a href="javascript:void(0);" class="dealFlowSelectedBox_payment active"><img src="../img/dealFlow/quanbu.png" />全部</a>
			<a href="javascript:void(0);" class="dealFlowSelectedBox_payment "><img src="../img/signing/zhifubao.png" />支付宝收款</a>
			<a href="javascript:void(0);" class="dealFlowSelectedBox_payment "><img src="../img/signing/weixin.png" />微信收款</a>
		</div>
	</div>
	<div class="dealFlowSelectedBox_line"></div>
	<div class="dealFlowSelectedBox">
		<div class="dealFlowSelectedBox_title">
			<em></em>
			<span>证件资料</span>
		</div>
		<div class="dealFlowSelectedBox_contBox">
			<a href="javascript:void(0);" class="dealFlowSelectedBox_certificate active">全部</a>
			<a href="javascript:void(0);" class="dealFlowSelectedBox_certificate ">收款成功</a>
			<a href="javascript:void(0);" class="dealFlowSelectedBox_certificate ">退款成功</a>
			<a href="javascript:void(0);" class="dealFlowSelectedBox_certificate ">收款失败</a>
		</div>
	</div>
	<div class="dealFlowSelectedBox_line"></div>
	<div class="dealFlowSelectedBox" style="padding: 0;">
		<div class="dealFlowSelectedBox_title" style="margin: 0 0.24rem;width: calc(100% - 0.24rem);">
			<em></em>
			<span>交易时间</span>
		</div>
		<ul class="dealFlowSelectedBox_timeBox">
			<li>
				<span>开始时间</span>
				<input type="text" id="starDate" name="starDate" value="" placeholder="请选择开始日期" readonly="readonly" />
				<img src="../img/index/index_xyjt.png" />
			</li>
			<li>
				<span>结束时间</span>
				<input type="text" id="endDate" name="endDate" value="" placeholder="请选择结束日期" readonly="readonly" />
				<img src="../img/index/index_xyjt.png" />
			</li>
		</ul>
	</div>
	<div class="dealFlowSelectedBox_bntBox">
		<a href="javascript:void(0);" class="dealFlowSelectedBox_bntBox_left">重置</a>
		<a href="javascript:void(0);" class="dealFlowSelectedBox_bntBox_right">确定</a>
	</div>
</div>
 
</body>
Copy after login

JS code:

<script type="text/javascript">
$(document).on(&#39;click&#39;,&#39;.dealFlowSelectedBox_bntBox_left&#39;,function(){
	$(&#39;.dealFlowSelectedBox_payment&#39;).removeClass(&#39;active&#39;);
	$(&#39;.dealFlowSelectedBox_certificate&#39;).removeClass(&#39;active&#39;);
	$(&#39;.dealFlowSelectedBox_payment&#39;).first().addClass(&#39;active&#39;);
	$(&#39;.dealFlowSelectedBox_certificate&#39;).first().addClass(&#39;active&#39;);
	$("input").val(&#39;&#39;);
})
</script>
Copy after login

Recommended learning: JavaScript video tutorial

The above is the detailed content of How to implement reset function in JavaScript. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Hot Topics

Java Tutorial
1657
14
PHP Tutorial
1257
29
C# Tutorial
1230
24
WiFi calling not working on iPhone: Fix WiFi calling not working on iPhone: Fix Jun 03, 2024 am 11:16 AM

Can't enable Wi-Fi calling on iPhone? Call quality is improved and you can communicate even from remote locations where cellular networks are not as strong. Wi-Fi Calling also improves standard call and video call quality. So, if you can't use Wi-Fi calling on your phone, these solutions might help you fix the problem. Fix 1 – Enable Wi-Fi Calling Manually You must enable the Wi-Fi Calling feature in your iPhone settings. Step 1 – For this, you have to open Settings. Step 2 – Next, just scroll down to find and open the “Phone” settings Step 3 – In the phone settings, scroll down and open the “Wi-Fi Calling” setting. Step 4 – In the Wi-Fi Calling page, change “This iPhone

How to implement an online speech recognition system using WebSocket and JavaScript How to implement an online speech recognition system using WebSocket and JavaScript Dec 17, 2023 pm 02:54 PM

How to use WebSocket and JavaScript to implement an online speech recognition system Introduction: With the continuous development of technology, speech recognition technology has become an important part of the field of artificial intelligence. The online speech recognition system based on WebSocket and JavaScript has the characteristics of low latency, real-time and cross-platform, and has become a widely used solution. This article will introduce how to use WebSocket and JavaScript to implement an online speech recognition system.

WebSocket and JavaScript: key technologies for implementing real-time monitoring systems WebSocket and JavaScript: key technologies for implementing real-time monitoring systems Dec 17, 2023 pm 05:30 PM

WebSocket and JavaScript: Key technologies for realizing real-time monitoring systems Introduction: With the rapid development of Internet technology, real-time monitoring systems have been widely used in various fields. One of the key technologies to achieve real-time monitoring is the combination of WebSocket and JavaScript. This article will introduce the application of WebSocket and JavaScript in real-time monitoring systems, give code examples, and explain their implementation principles in detail. 1. WebSocket technology

How to reset recommended content on TikTok? How to set up its recommended content? How to reset recommended content on TikTok? How to set up its recommended content? Mar 27, 2024 pm 07:30 PM

Douyin, the world's most popular short video platform, allows everyone to become a creator and share every moment of life. Sometimes we may get tired of the content recommended by Douyin and hope to reset the recommended content so that the platform can re-evaluate and push content more suitable for us. So, how does Douyin reset recommended content? This article will answer this question in detail. 1. How to reset recommended content on Douyin? Douyin makes personalized recommendations based on users’ viewing history, interactive behavior, interests and preferences and other data. Currently, the Douyin platform does not directly provide the option to reset recommended content. However, there are a few things users can do to try to reset recommended content, such as clearing their viewing history, unfollowing content creators they are not interested in, and diversifying their viewing content to change their recommendations.

How to use JavaScript and WebSocket to implement a real-time online ordering system How to use JavaScript and WebSocket to implement a real-time online ordering system Dec 17, 2023 pm 12:09 PM

Introduction to how to use JavaScript and WebSocket to implement a real-time online ordering system: With the popularity of the Internet and the advancement of technology, more and more restaurants have begun to provide online ordering services. In order to implement a real-time online ordering system, we can use JavaScript and WebSocket technology. WebSocket is a full-duplex communication protocol based on the TCP protocol, which can realize real-time two-way communication between the client and the server. In the real-time online ordering system, when the user selects dishes and places an order

How to solve win11 reset problem How to solve win11 reset problem Jan 05, 2024 am 09:24 AM

After the launch of win11, many users directly updated it. However, after the update, many users experienced reset failure and did not know how to solve it. So today we bring you the solution to win11 reset failure. Come and see how it works. How to solve win11 reset failure 1. First, click Start in the lower left corner, click Settings, and then select Update and Security. 2. Click the Recovery button on the left and click Start under the Reset this PC option. 3. You can then select an option. 4. Finally, wait for the installation of win11 system to solve the problem. 5. Users can also directly download the win11 system from this site to solve the problem.

How to implement an online reservation system using WebSocket and JavaScript How to implement an online reservation system using WebSocket and JavaScript Dec 17, 2023 am 09:39 AM

How to use WebSocket and JavaScript to implement an online reservation system. In today's digital era, more and more businesses and services need to provide online reservation functions. It is crucial to implement an efficient and real-time online reservation system. This article will introduce how to use WebSocket and JavaScript to implement an online reservation system, and provide specific code examples. 1. What is WebSocket? WebSocket is a full-duplex method on a single TCP connection.

JavaScript and WebSocket: Building an efficient real-time weather forecasting system JavaScript and WebSocket: Building an efficient real-time weather forecasting system Dec 17, 2023 pm 05:13 PM

JavaScript and WebSocket: Building an efficient real-time weather forecast system Introduction: Today, the accuracy of weather forecasts is of great significance to daily life and decision-making. As technology develops, we can provide more accurate and reliable weather forecasts by obtaining weather data in real time. In this article, we will learn how to use JavaScript and WebSocket technology to build an efficient real-time weather forecast system. This article will demonstrate the implementation process through specific code examples. We

See all articles