jquery - using a variable in the input tag's style attribute -


I have a dropdown box with three values, small, medium and large. If the price is small, then the text that is created should be 100px, if the medium is 200px larger, based on this value 400px, I can save the size in one variable, and use that variable in a style attribute?

For example, I value the drop down box

 <. Code> FieldSize = $ ('# FieldSize') fieldValue ();  

Can I use the code, if (fielded == "small") {size = 100;} and the style of that size in the style attribute? (Field type == "text") {$ ("& lt; input id = inputstr" + increment + "type = 'text' style = (style = 'width: size PX')

  'Width: 100px' & gt; & lt; / Input & gt; & lt; br & gt; & lt; br & gt; "). AppendTo (" # fb_contentarea_col1down21 "); } To check the value of the field, just make a switch statement small = "100px"  

Then type in your attachment code $ ("

Comments

Popular posts from this blog

c++ - Linux and clipboard -

Visual Studio 2005: How to speed up builds when a VSMDI is open? -

booting ubuntu from usb using virtualbox -