Aarti Borole
Aarti Borole

Reputation: 33

Onclick clear or hide label having same class name

This is my code:

<label class="name">
<input class="required|number error" type="text" name="phone" value="">
<label class="error" for="phone" generated="true">This field is required.</label>
</label>

On click clear button I want to clear or hide value of error class label.

Any idea?

Upvotes: 0

Views: 286

Answers (2)

writeToBhuwan
writeToBhuwan

Reputation: 3281

$(".clear").click(function(){
    $(".error").hide();
});

Upvotes: 2

Prasanth Bendra
Prasanth Bendra

Reputation: 32800

$(".clear").click(function(){
    $(".error").html("");
});

Upvotes: 1

Related Questions