-1

In the following jQuery script, I am trying to replace "2500px" with $(document).height() but it's not working.

$("#mydiv").css("cssText", "position: relative; width:30%; height:2500px!important;");

This is what I did but it's not working:

$("#mydiv").css("cssText", "position: relative; width:30%; height:"+$(document).height()+"!important;");

Am I missing something here?

user1448031
  • 2,116
  • 11
  • 42
  • 86

1 Answers1

-1

Updated: You can use cssText like below:

$('#mydiv').css('cssText','height: 2500px !important');
Bhojendra Rauniyar
  • 78,842
  • 31
  • 152
  • 211