1.
<input type='text' onclick = 'Clickon(this)'>
<script>
function Clickon(num){
num.style.backgroud = 'red'
}
</script>
2. <input type='text' id='i1'>
<script>
var tag = document.getElementById('i1')
tag.onclick = function(){
tag.style.background = 'red'
}
</script>