Set max-height using javascript

前端 未结 3 1827
庸人自扰
庸人自扰 2021-02-15 08:25

I have a div, and the maximum width for this div is user defined. I know I can get it done using element.style.height but this doesn\'t work in IE.

Any ideas on how to i

3条回答
  •  囚心锁ツ
    2021-02-15 08:44

    document.getElementById ( "yourelementid" ).style.maxHeight = "100px";
    

    See maxHeight Property

    maxHeight was introduced in Windows Internet Explorer 7

提交回复
热议问题