tags:

views:

106

answers:

2

I have some asp textboxs in a div container. I just want to clear those when i am clicking the CLEAR button.

I say common class 'text' for all textboxes and then wrote this jQuery

$(".text").text(""); 

It's not working ..

How to do this ? I need the most efficient code .

+2  A: 
$('a.clearButton').bind('click', function() {
    $('#divId input').val('');
});

Notes:

  1. You should use val() instead of text().

  2. You are asking for efficient code - and using class selector is not efficient.

    Either use id, or add tag name.

Sagi
A: 
$('#yourcontainerid input:checked').removeAttr('checked');
Darin Dimitrov