I’m trying to make my button bigger when it receives focus:
<html>
<form name="myForm">
<button onfocus="width=200; height=200">myButton</button>
<button>myOtherButton</button>
</form>
</html>
Any idea how can I make it work?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I imagine after implementing this, you will also want to restore the size after the focus leaves.
If you’re doing much more than that, I would recommend separating this code into functions and making better JavaScript design decisions.