In a webpage I am writing I want to be able to clear two text boxes when I click on either one of them. So far I have been able to clear one when I click the other, but it won't clear itself.
Here is my html/javascript so far:
<!DOCTYPE html>
<html>
<head>
<script>
function clear()
{
var c = document.getElementById('c');
c.value = '';
var f =document.getElementById('f');
f.value= '';
}
</script>
</head>
<body>
<input placeholder = "Celsius" id="c" onclick='clear()'></br>
<input placeholder = "Fahrenheit" id="f" onclick='clear()'></br>
</body>
<p>
</p>
</html>