如何更改文本框焦点上的按钮颜色 [英] How to change button color on textbox focus

查看:77
本文介绍了如何更改文本框焦点上的按钮颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我有一个场景,当焦点出现在文本框上时,按钮的颜色应该改变。任何人都可以帮助我在ASP.NET?

Hi,

I have a scenario that when focus comes on textbox the color of button should be changed. Can anyone help me with that in ASP.NET?

推荐答案

为了将来参考,一个简单的谷歌搜索可以帮助你快速。



使用文本框的onfocus事件。然后让它调用一个更改按钮颜色的javascript函数。



W3schools.com有一个很好的交互方式来查看onfocus事件的工作原理。在这种情况下,他们会更改文本框颜色,但在此时更改按钮的颜色应该是微不足道的。



http://www.w3schools.com/jsref/event_onfocus.asp [ ^ ]。单击自己尝试按钮。
For future reference, a simple google search can help you out quickly.

Use the onfocus event of the textbox. And then have it call a javascript function which changes the color of the button.

W3schools.com has a good interactive way to see how the onfocus event works. In this case they change the textbox color but changing the color of the button should be trivial at that point.

http://www.w3schools.com/jsref/event_onfocus.asp[^]. Click the "Try it yourself" button.


这篇关于如何更改文本框焦点上的按钮颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆