[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 304
  • Last Modified:

alter width of textbox

looking through a php, ajax, jquery content management system

what are different ways to alter width of textbox
0
rgb192
Asked:
rgb192
  • 2
1 Solution
 
HainKurtSr. System AnalystCommented:
huh? any code?

javascript:

document.getElementById("txtBoxID").width = 300;
0
 
hieloCommented:
//set the style.width
document.getElementById("txtBoxID").style.width = '300px';

//set a css class
document.getElementById("txtBoxID").className='theClass';

and then provide the css for that element either in an external stylesheet or within a <STYLE> tag:
.theClass{ width: 300px;}
0
 
hieloCommented:
NOTE: you also need to set it's display property to "block":
document.getElementById("txtBoxID").style.width = '300px';
document.getElementById("txtBoxID").style.display= 'block';

or using the class:
.theClass{ width: 300px;display:block;}
0
 
rgb192Author Commented:
thanks
0

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now