jquery - 根据值更改大小

标签 jquery css

这是我的代码:

var changeValue = document.getElementById("fontSize");
changeValue.value= 400;

var changeSign = document.getElementById("Box");
changeSign.style.width = ?;

我想根据 "fontSize" 值更改框宽度,在本例中为 400。

最佳答案

这是您要的吗? changeSign.style.width = changeValue.value + 'px'

关于jquery - 根据值更改大小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33861422/

相关文章:

javascript - 如何防止向 javascript 数组添加重复键

jquery - MVC 部分 View 中的命名约定以避免 ID 冲突

jquery - 不同的没有。不同屏幕分辨率下的列数

html - 溢出 : hidden not working when its at a certain width 1440px

php - 使用 facebook 评论时错误 iframe 不会在 Chrome 中滚动?

javascript - jQuery/JavaScript : Check all checkboxes and Check each checkbox to display div

javascript - 选择没有任何包含字符串的类的元素

html - 没有 li 的 CSS li 悬停 :after

html - box-sizing : border-box on a <aside> element 问题

html - 为什么我的 img 在我的 HTML/CSS 表格中的大小不正确?