how to add js for input onfocus
Application Type

i am developing the application in which whenever i will click on input field the selective picture from the right should get selected how can i get that? 

desired output...

i am trying to add js in onfocus of input field  and trying getElementById i am getting element id there but i am not able to implement style.border i need to add border in that 




Hi @Vaibhav singh Baghel ,

Your bottom-right image that you want highlighted has the id "handset", so just pass that id of that element to the javascript node and type the following:

Just adjust the color and styles to your need. your issue was that you were trying to give those styles to a wrong element!

Let me know if this helped!


thanks for your help but after that field goes unfocused it is still highlighted it should be only till the field is onfocus.

For that you can remove the styles you previously added on the OnBlur action. onblur action happens when you leave the field.

And in that case, it is better if you write a css class with the styles you want to apply,and in the onfocus event you add that class to your element classList.

On the onblur event, you remove that class from the element classlist!

Tell me if this helped!

Thanks for your kind help.

It helped me a lot. 



Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.