【发布时间】:2013-08-29 03:59:38
【问题描述】:
我希望能够使用Math.js 和输入框将用户给定的数量转换为网站上的另一个数量,但无论我尝试什么都无法从标有“转换”的输入框中获取用户输入,并且更改。我怎样才能做到这一点?
<!DOCTYPE html>
<html>
<head>
<title>Convert</title>
<script type="text/javascript" src="https://raw.github.com/josdejong/mathjs/master/dist/math.js"></script>
</head>
<body>
<input type="text" id="convert"></input>
<script>
function print(value) {
document.write(math.format(value) + '<br>');
}
print(math.eval('"TEXT IN CONVERT BOX HERE" inch in cm'));
</script>
</body>
</html>
【问题讨论】:
-
你能详细说明你的问题吗?
标签: javascript html input