Hapus data bidang input pada tombol klik

<button type="button" onclick="ClearFields();">Clear</button>

function ClearFields() {

     document.getElementById("textfield1").value = "";
     document.getElementById("textfield2").value = "";
}
Nipun