How I can uncheck checkbox when both of my inputs [type=text] cleared or empty?

How I can uncheck checkbox when both of my inputs [type=text] cleared or empty?

How I can uncheck&nbsp;input&nbsp;of type&nbsp;<strong>checkbox</strong>&nbsp;when both of my&nbsp;inputs of type&nbsp;<strong>text</strong>&nbsp;are empty, and checked if one of my&nbsp;inputs of type&nbsp;<strong>text</strong>&nbsp;is filled?

How I can uncheck input of type checkbox when both of my inputs of type text are empty, and checked if one of my inputs of type text is filled?

$('input[name="t2"],input[name="t3"]').keyup(function() {
  $('input[name="t1"]').prop("checked", $.trim($(this).val()).length != 0);
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>

<input type="checkbox" name="t1" /> Price range from: <input type="text" name="t2" /> to <input type="text" name="t2" />

 Run code snippetExpand snippet

JSFiddle : here in this link

It executes correctly when I type something on any input type text(checkbox checked), but not working when I clear both of fields, because the checkbox unchecked when only one of inputs clear. Would you please help me solve this? Thank you

javascript jquery forms

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

Understand and Use JavaScript's .forEach() vs. jQuery's .each()

There are two functions to deal with an array on the client-side – JavaScript's .forEach() and jQuery's .each(). Here, I will teach you how to use both of these methods with some sample code.

jQuery vs Vanilla JavaScript - Beau teaches JavaScript

When should you use jQuery instead of vanilla JavaScript? Is jQuery still relevant? What is jQuery good for? jQuery vs vanilla JavaScript - Beau teaches JavaScript

The essential JavaScript concepts that you should understand

The essential JavaScript concepts that you should understand - For successful developing and to pass a work interview

jQuery Live -1 | jQuery AJAX Tutorial for Beginners | jQuery Tutorial

jQuery Live -1 | jQuery AJAX Tutorial for Beginners | jQuery Tutorial

Form Validation In JavaScript | JavaScript Form Validation

JavaScript Form Validation, you will learn how a web form can be validated on the client computer before sending it over to the server. We use a simple demo to validate the email ID and password fields in a form.