How to change input value in formly?

I am trying to change the width of an input (button) via CSS/ Can i do this? this is my code that failed... <style type="text/css"> input {width:10px;} </style> <input type="button" value="OOOOOOOOOOOOOOOO" onmouseover="style='width:100%'">

  • Answer:

    You've specified the button width twice: once in the <style> tag and once in the <input> tag. I'm pretty sure the spec in the input tag takes precedence, so the 10px width should not be evaluated. The "width:100%" means that the button should have the same width as its parent element IIRC. Is this what you want? I recommend getting rid of inline styles and using an external stylesheet instead. I find it cuts down on confusion and makes for less typing. Your mileage may vary.

jkb3614 at Answerbag.com Visit the source

Was this solution helpful to you?

Other answers

Try this: <style type="text/css"> <!-- .button { display: inline-block; width: 120px; } .button:hover { width: 100%; } --> </style> <input type="button" class="button" value="Button" /> Try to avoid using inline CSS or Javascript. If you needed to use Javascript, you could do this, but I still highly recommend using CSS instead: <input type="button" class="button" value="Button" onmouseover="this.style.width='100%';" /> Good luck!

ClearNone

Try input.button {width:XXpx;} 10px is pretty small....

JimmyG

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.