How to set the size or width of an input element in javascript.
I am using input_obj.size= '40%'开发者_JAVA百科;
But, it is not working.
You set the size as per your own example — but it doesn't take a CSS length. It takes an integer (number of characters).
The width is set as per any other element: input_obj.style.width.
You should use style attribute:
  input_obj.style.width = '40%';
If input_obj is your input obj (which I assume according to the name ;))
input_obj.style.width = '100px';
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论