Javascript 如何计算股息的10%?JQuery
我有这个样本: 代码HTML:Javascript 如何计算股息的10%?JQuery,javascript,jquery,html,css,Javascript,Jquery,Html,Css,我有这个样本: 代码HTML: <div> </div> div{ width:200px; height:500px; background:red; } jQuery(document).ready(function ($) { var height= $('div').outerHeight(); alert(height); }); 代码JS: <div> </div> div
<div>
</div>
div{
width:200px;
height:500px;
background:red;
}
jQuery(document).ready(function ($) {
var height= $('div').outerHeight();
alert(height);
});
代码JS:
<div>
</div>
div{
width:200px;
height:500px;
background:red;
}
jQuery(document).ready(function ($) {
var height= $('div').outerHeight();
alert(height);
});
目前,我保留了一个可变高度的div。
我想保留一个变量,即div高度的10%。这是一个简单的数学问题:
jQuery(document).ready(function ($) {
var height= $('div').outerHeight()/10;
alert(height);
});
这只是一道简单的数学题…
将高度乘以
0.1
var height=$('div').outerHeight()*.1代码>
jQuery(文档).ready(函数($){
var height=$('div').outerHeight()*0.1;
警戒(高度);
});代码>
div{
宽度:200px;
高度:500px;
背景:红色;
}
您是否尝试过var height=$('div').outerHeight()*10/100代码>?var tenpct=height*0.1
?我遗漏了什么吗?可能是重复的