I am calling a function on a button click. But the function is not getting called. I dont know what I am doing wrong. Please help.
<!DOCTYPE html>
<html>
<head>
<title></title>
<script type="text/javascript">
function clear() {
document.getElementById('inp').value = "";
}
</script>
</head>
<body>
<input type="text" id="inp" name="">
<input type="button" onclick="clear()">
</body>
</html>