Thursday, April 30, 2009

How to clear all the text field

function clearAll() {
    var txtField = document.getElementsByTagName('input')
    for (var i_tem = 0; i_tem < txtField.length; i_tem++)
        if (txtField[i_tem].type == 'text')
        txtField[i_tem].value = ''
}

No comments: