jQuery Remove Element by id name class tag

jQuery Remove Element by id name class tag

How to remove text, element by class name, id, attribute using jquery remove(), unwrap(), empty(). Here you can learn this remove elements method by jquery.

jquery remove element by it's id, name, class, tag etc.

Angular 9 Tutorial: Learn to Build a CRUD Angular App Quickly

What's new in Bootstrap 5 and when Bootstrap 5 release date?

What’s new in HTML6

How to Build Progressive Web Apps (PWA) using Angular 9

What is new features in Javascript ES2020 ECMAScript 2020

How to remove CSS class from multiple ID elements using JS?

I have a code that removes a class from ID in a certain condition, now I have more ID's that needs the same, how can I do it in an easy short way?

I have a code that removes a class from ID in a certain condition, now I have more ID's that needs the same, how can I do it in an easy short way?

instead:

$("#id-1").removeClass("otout");
$("#id-2").removeClass("otout");
$("#id-3").removeClass("otout");
$("#id-4").removeClass("otout");

Something like this:

$("id-1, id-2, id-3, id-4").removeClass("otout");

Any chance it is possible?

jQuery remove one tag

Example have 1 include 2 :

Example have 1 include 2 :

<tr>
  <td>
       <p>1</p>
       <p>Jones</p>
       <p>USA</p>
       <button class="delete">Delete</button>
   </td>
</tr>
<tr>
  <td>
       <p>2</p>
       <p>David</p>
       <p>USA</p>
       <button class="delete">Delete</button>
   </td>
</tr>

I want to when I click "Delete", Only 1 is deleted. Example: I click "delete" in second , The second is deleted, The first is still exist

How to pass the id name to the jQuery validation and send to the controller?

I have two anchor tag and on click, I have to get the id value.

I have two anchor tag and on click, I have to get the id value.

so I tried below code and I am getting the id. Now after getting the id, I have to display the popup. so popup is also displaying.

<div class="buttonSet">
  <a href="javascript:void(0);" id="sample1">Sample one</a>
  <a href="javascript:void(0);" id="sample2">Sample two</a>
  </div>
$(".buttonSet a").click(function() {
    alert(this.id);//getting the id name, just for an example
    $('#Popup').show();
});

Popup code is

<div class="" id="Popup" style="display:none">
<form action="" method="post" name="form1" id="form1" autocomplete="off">
<div class="form-group ffl-wrapper">
<label for="name" class="ffl-label">Name</label>
<input type="text" name="name" class="form-control" id="name">
</div>

  &lt;div class="form-group ffl-wrapper"&gt;
    &lt;label for="email" class="ffl-label"&gt;Email&lt;/label&gt;
    &lt;input type="email" name="email" class="form-control" id="email"&gt;
  &lt;/div&gt;

  &lt;div class="form-group ffl-wrapper"&gt;
    &lt;label for="mobileno" class="ffl-label"&gt;Mobile Number&lt;/label&gt;
    &lt;input type="text" name="mobileno" class="form-control" id="mobileno"&gt;
  &lt;/div&gt;


  &lt;div class="form-group text-center btn_submit_action"&gt;
    &lt;input type="submit" name="send" class="" value="Submit"&gt;
  &lt;/div&gt;
&lt;/form&gt;

</div>

Now I am confused how do I pass the id value to the jQuery validation and how to submit button will work. I mean I have one form and two buttons. The Same form will open on button click. I have to get the information that which button is clicked and pass that button id to the jQuery validation and send to the form. Because I have to store the name of the button which is clicked.

jQuery validation

$("#form1").validate({
rules: {
name: {
required: true,
minlength: 3,
lettersonly: true
},
email: {
required: true,
email: true
},
mobileno: {
required: true,
minlength: 10,
maxlength: 10,
number: true
}
},
submitHandler: function(form) {
$.ajax({
url: "//my url",
type: "POST",
data: $('#form1').serialize(),
success: function(data) {
$("#Popup").hide();
$("#popup_success").show();
},
}); // AJAX Get Jquery statment
}
});