javascript - How do you dynamically apply style to an element, type and class in jQuery? -




i need apply style:

<style> #elementid td[role='gridcell'] { height: 136px !important; } </style> 

but need calculate height dynamically. how can set style using javascript?

thanks! in advance!

1) in css use of calc function.

read more calc: https://www.w3schools.com/cssref/func_calc.asp

for example :

#elementid td[role='gridcell'] { height: calc(100%-20px) !important; } 

2) in jquery.

for example:

$(document).ready(function(){     var dynamic = calculate....     $("#elementid td[role='gridcell']").css("height", dynamic); }) 




wiki

Comments

Popular posts from this blog

Asterisk AGI Python Script to Dialplan does not work -

python - Read npy file directly from S3 StreamingBody -

kotlin - Out-projected type in generic interface prohibits the use of metod with generic parameter -