What is the best way to reset or clear checkboxes in Vuejs when a label is clicked?

<div class="thickness-productlist">CLEAR</div>
  <span class="anchor3" @click="thicknessOnClick">Select (mm)</span>
              <ul class="items3">
                <div class="checkbox-alignment-application-filter">
                  <input
                    type="checkbox"
                    id="thickness-filter1"
                    class="vh-product"
                  />
                  <label class="productlist-specific" for="thickness-filter1"
                    >2.0mm</label
                  >
                </div>
                <div class="checkbox-alignment-application-filter">
                  <input
                    type="checkbox"
                    id="thickness-filter2"
                    class="vh-product"
                  />
                  <label class="productlist-specific" for="thickness-filter2"
                    >22.0mm</label
                  >
                </div>
                <div class="checkbox-alignment-application-filter">
                  <input
                    type="checkbox"
                    id="thickness-filter3"
                    class="vh-product"
                  />
                  <label class="productlist-specific" for="thickness-filter3"
                    >3.0mm</label
                  >
                </div>
                <div class="checkbox-alignment-application-filter">
                  <input
                    type="checkbox"
                    id="thickness-filter4"
                    class="vh-product"
                  />
                  <label class="productlist-specific" for="thickness-filter4"
                    >4.0mm</label
                  >
                </div>
              </ul>

How do I clear the checkboxes by clicking on "CLEAR" in the dropdown menu that contains them? I am considering using a toggle function to set and reset the data value, but I'm unsure how to begin.

Answer №1

This question seems to have already been asked and answered on StackOverflow. You can find the solution at this link: Uncheck CheckBox with its label in VueJS

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

When passing context to createPage for use in a query, there may be issues if a string is inadvertently converted to a number, causing the query to fail

I am facing an issue with a page creation function that I have implemented. Here is the code snippet: createPage({ context: { productId: String(productId) }, Despite explicitly converting the ID to a string, the page template is still receiving it as a ...

Error: Ajax unable to parse JSON - property 'name' does not exist in the object

When accessing my report.php file, it returns a json data. Here is the snippet of javascript code I am using to try and read the json: <script src="http://code.jquery.com/jquery-1.9.1.min.js"></script> <script> $(document).ready(function ...

What could be the reason for the issue with Backbone.js and modal window breaking on IE9?

I have a basic contact management table in backbone.js that utilizes twitter's bootstrap-modal to display the form input. While everything works smoothly in Firefox and Chrome, I am encountering issues with the modal not appearing in IE 9. Additional ...

What is the process for printing with JQuery?

I have nested divs with dynamically generated images in my HTML code. My problem is that when I click the print button, I want the corresponding image to be printed. <div id="outputTemp" style="display:none"> <div id="rightoutputimgae"> <di ...

What are some solutions to correct a tab layout that is utilizing absolute positioning?

Although I understand how absolute positioning works, it is currently disrupting the layout in this particular case. Using min-height with media queries for various screen sizes seems like a viable solution, but it's not foolproof considering that the ...

mobile input sliders for selecting ranges

While working on a custom audio player, I encountered an issue with the default html5 input range object. Everything else seems to be working perfectly, with all events firing as needed, except for a frustrating problem on mobile Safari with iOS 11.4: Whe ...

What is the reason for being able to access `$scope` and `this` using the controller as syntax?

Creating an Angular controller with the controller as syntax: <body ng-controller="ctrl as myCtrl"> <p>Accessed via scope resolution: {{ foo }} </p> <p>Accessed via controller resolution: {{ myCtrl.foo }}</p> </body> ...

Is there a more secure alternative to using the risky eval() function? Do I need to take the lengthier route by implementing a switch case instead?

I've been practicing and honing my Javascript skills by working on a calculator code that initially had lots of repetitive lines. I managed to simplify it, but I am aware that using the eval() method is not generally recommended. let current = 0; f ...

Can you explain the variance between "quasar dev" and "quasar dev #" commands?

Just starting out with Quasar and following along with a tutorial. The tutorial instructs me to use "quasar dev," but it doesn't seem to be working for me. The documentation for "quasar create" suggests using "quasar dev #" which does work. I'm c ...

What is the best way to ensure the header and sidebar stay fixed while allowing the rest of the page content to flow in

I am working on a website where I want the header and sidebar to remain fixed while the other pages open in the remaining space. How can I make the sidebar dynamic? Here is an example of what I am trying to achieve: https://i.sstatic.net/MBFesWfp.png How ...

JavaScript and AJAX for Making Decisions

I'm encountering an issue with the decision-making part of my form. I am trying to set up a form on an HTML page that includes radio buttons and a checkbox, but I am struggling to retrieve data from my .php file. The problem seems to lie in the .php s ...

"Bringing angular2-cookie into an angular4 project: A step-by-step guide

I am currently facing an issue while trying to integrate angular2-cookie into my angular4 project. The project I am working on is developed with Angular and, in particular, here is the content of my package.json: { "name": "ng-admin", "version": "0.0 ...

How can I change an element using jQuery's getElementById method?

My current setup involves using a web page as a server and an Arduino as a client. Whenever a specific mode is active, the Arduino sends the following code: <LED>on</LED> The server then adjusts its status accordingly based on this input. I ...

Ionic3(ios) restricted from loading local resource

I encountered an issue with my code Not allowed to load local resource: file:///var/mobile/Containers/Data/Application/AB6EABD9-CAAF-4AE5-91F9-D8042B34EA87/tmp/cdv_photo_002.jpg This is the code snippet causing the problem let cameraOptions = { ...

ajax does not function properly with arrays

i'm currently attempting to load data from a text file into an array using ajax, and this is the code i am utilizing: function loadWords(){ var xhr = new XMLHttpRequest(); xhr.open('GET', "dico/francais.html"); xhr.onreadystatec ...

Utilizing enum values from a model in a component

I have been trying to retrieve a value from a model that is of type enum, but I am struggling to figure out how to do it. I've spent a significant amount of time on this issue without reaching a solution. Here is my Model code: const mongoose = requ ...

simpleCart - Utilizing a modal window for easy input and sending the shopping cart data to PHP in a multidimensional array

Currently, I am working with the simpleCart JavaScript shopping cart, but I have encountered a minor issue. When a customer clicks "checkout," a modal pops up requiring them to enter their contact information. Upon submitting the form, an email is sent to ...

Enhancing user experience: Implementing specific actions when reconnecting with Socket.io after a disconnection

I am working on a game using node.js and socket.io. The code I have written is quite simple. The game starts animating as soon as it connects to the server and continues to do so. My main concern is ensuring that the game handles network and server disco ...

Exploring jQuery's parent selector for traversing the DOM

I am currently working with an array that inserts articles into my website. I have a specific requirement where, upon clicking the title (h3), I need to display more information based on the article's index. To achieve this, I believe I should travers ...

Utilize Underscore and Mongoose to set documents as the return value of an outer function

Exploring the possibility of using Mongoose and Underscore in conjunction, I'm attempting to achieve something along these lines: var person_ids = [1, 2, 3]; var persons = _(person_ids).map(function(id) { Person.findById(id, function(person) { / ...