该楼层疑似违规已被系统折叠隐藏此楼查看此楼
1=
转换
var content = []
var name = ""
var yincheng = 0
var result = ""
var yinjieName=["c","c#","d","d#","e","f","f#","g","g#","a","a#","b"]
var yinjie = ["1","1#","2","2#","3","4","4#","5","5#","6","6#","7","1","1#","2","2#","3","4","4#","5","5#","6","6#"]
function exchange(){
result =""
var content = document.getElementById("box").value.split(" ");
name = document.getElementById("gggname").value
yincheng = yinjieName.indexOf(name);
content.forEach(function(e){
if(yinjie.indexOf(e) == -1){
result += e+" "
}else{
result += yinjie[yinjie.indexOf(e)+yincheng] +" "
}
})
document.getElementById("result").innerHTML = result
}