Need to get the typed value after typing using JavaScript but function not working.

my code:

```
<input onkeyup= "myfunction()" type="number" name="textboxname" value="">

<script>

 function myfunction()
 {
   alert($(this).val());
 }

</script>

```