0

Hi everyone I am using outerWidth() method to get width property of input type="text" field. which I am setting on the search box, It is setting correctly on localhost but not on server what is the issue can anybody help me. Here in code this is input box thanks

var search_id = $(this).attr('id');
var width = $(this).outerWidth();
<div id="total_div_'+search_id+'" tabindex="0" style="width:'+width+';max-height:230px
user3245779
  • 31
  • 2
  • 8

1 Answers1

0

you need to do like below

$("#total_div_").css("width",""+ width +"px");

your code is wrong you are trying to add width varaible through style which can not ba work so try like above

Sumit Pathak
  • 671
  • 1
  • 6
  • 25