Set value in on click event use this.value
For example:
<input type="text" name="fullname" onclick="fullname(this.value)">
<script type="text/javascript"> function fullname(val){ alert(val); } </script>
If you want to check you browser console, the follow this code.
<script type="text/javascript"> function fullname(val){ console.log(val); } </script>
Question and answer is powered by AnsPress.io