Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change the size of input with jquery

Tags:

html

jquery

dom

I have the following input:

<input id="input_2_2" 
       class="medium" 
       type="file" 
       tabindex="4" 
       size="20" 
       value="" 
       name="input_2">

I don't have access to the HTML therefore I would like to apply jQuery to change the size to "60".

Please can someone help?

like image 951
Steven Jones Avatar asked Jun 13 '12 16:06

Steven Jones


2 Answers

You can use the .attr method:

$('#input_2_2').attr('size',60);
like image 81
WojtekT Avatar answered Sep 23 '22 18:09

WojtekT


Use this:

$("#input_2_2").attr("size", "60");

I believe that should work..

like image 22
Tom O Avatar answered Sep 24 '22 18:09

Tom O