Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

onfocus

//The onfocus event occurs when an element gets focus
Enter your name: <input type="text" onfocus="myFunction(this)">

<p>input field gets focus & a function is triggered changes the background-color.</p>

<script>
function myFunction(x) {
  x.style.background = "yellow";
}
</script>
Comment

PREVIOUS NEXT
Code Example
Javascript :: react native expo flatlist 
Javascript :: javascript wait for function to finish 
Javascript :: node cron install 
Javascript :: javascript fetch APIjson 
Javascript :: pass data between pages react 
Javascript :: javascript formate date 
Javascript :: new line in javascript string 
Javascript :: redux toolkit remove from array 
Javascript :: stdout javascript 
Javascript :: javascript some method 
Javascript :: sort numbers in array in js 
Javascript :: .includes is not a function 
Javascript :: remove an last item of array in javascript 
Javascript :: electron ipc from main to renderer 
Javascript :: how to use buffer in angular by using browserify 
Javascript :: js how to get max sub array sum 
Javascript :: login with facebook in react 
Javascript :: input type number max value validation 
Javascript :: Remove items from an index position 
Javascript :: reactjs get one document from firestore 
Javascript :: last element of array 
Javascript :: byte to integer js 
Javascript :: javascript less than but greater than 
Javascript :: how to run react native app on simulator 
Javascript :: angular 8 enable routing 
Javascript :: reactjs lifecycle class components 
Javascript :: react chartjs 
Javascript :: how to use data sets javascrip[t 
Javascript :: npm paypal express checkout 
Javascript :: react create array 
ADD CONTENT
Topic
Content
Source link
Name
5+9 =