unemployment Posted June 1, 2011 Share Posted June 1, 2011 How can I clear an input field value using an onclick event on a different element? link.onclick = function(){ input = ''; } This fails. Link to comment https://forums.phpfreaks.com/topic/238149-clear-input-field-value/ Share on other sites More sharing options...
KevinM1 Posted June 1, 2011 Share Posted June 1, 2011 Try one of: link.onclick = function(){ input.value = ''; } or link.onclick = function(){ input.innerHTML = ''; } Link to comment https://forums.phpfreaks.com/topic/238149-clear-input-field-value/#findComment-1223779 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.