相关疑难解决方法(0)

1603
推荐指数
22
解决办法
132万
查看次数

用户在文本字段中输入的数字的数值

我需要添加用户输入的两个数字.为此,我创建了两个输入字段,从它们中检索值,使用.val(),在两个单独的变量中,然后添加它们.问题是添加了字符串而不是数字.例如.2 + 3变为23而不是5.请建议做什么,除了在输入框中使用type = number.

html javascript

6
推荐指数
1
解决办法
1万
查看次数

列出对象中的所有变量名称

我有这个对象:

var sub = {
    0:  [""],
    21: ["Look, here, are three little stuff,","ready to sing for this crowd"],
    28: ["Listen up, 'cause here's our story","I'm gonna sing it very LOUUU..."],
    36: [""],
    45: ["VERY LOUUU..."],
    48: [""],
    61: ["When you're a younger stuff","and your stuff is very bare"],
    68: ["Feels like the sun will never come","when your stuff's not there"],
    74: ["So the three of us will fight the fight","there is nothing that we fear"],
    80: ["We'll have to …
Run Code Online (Sandbox Code Playgroud)

javascript arrays

3
推荐指数
1
解决办法
1580
查看次数

标签 统计

javascript ×3

arrays ×1

data-conversion ×1

html ×1

integer ×1

string ×1