Hi readers !
In this blog we will see how we can clear all textboxes in a form using jQuery .
To clear a textbox with id 'txtBox1' in javascript we use below code :
document.getElementById('txtBox1').value = '';
We can use this code to clear specific textboxes with specific ids. But sometimes user wants to clear all the textbox in a form . So to clear all the textbox values in a form using jQuery we can use below code.
function fnClearAll()
{
var parentDoc1 = window.parent.document;
$(parentDoc1).find('input[type=text]').val('');
}
0 Comment(s)