//var element2 = document.getElementsByTagName("a-box"); //a-sphereの要素を所得し、elementに配列として入れる[1つ目の<a-sphere>,2つ目の<a-sphere>] var element = document.getElementById("sample-obj1"); element.addEventListener("click", function() { location.href = "https://www.muji.com/jp/ja/store"; },false); var element2 = document.getElementById("sample-obj2"); element2.addEventListener("click", function() { location.href = "https://ja.wikipedia.org/wiki/%E3%83%9E%E3%83%AA%E3%83%BC%E3%83%B35%E6%B8%85%E6%B0%B4%E5%B1%8B"; },false); var element3 = document.getElementById("sample-obj3"); element3.addEventListener("click", function() { location.href = "https://ta4g500.gorp.jp/"; },false); //var element4 = document.getElementById("sample-obj4"); // element.addEventListener("click", function() { // location.href = "https://www.muji.com/jp/ja/store"; //},false); //element[0].addEventListener("click", function() { // location.href = "https:"; //},false); //element[1].addEventListener("click", function() { // location.href = "https:"; //},false); var sphere=[]; function Click(){ var au = shape.value; document.getElementById("changeObject1").innerHTML = "<" + au + ' id="sample-obj1" position="6 -3 8" color="tomato"></' + au + '>'; document.getElementById("changeObject2").innerHTML = "<" + au + ' id="sample-obj2" position="10 2 -8" color="red"></' + au + '>'; document.getElementById("changeObject3").innerHTML = "<" + au + ' id="sample-obj3" position="-25 2 -8" color="yellow"></' + au + '>'; // document.getElementById("changeObject4").innerHTML = "<" + au + ' id="sample-obj4" position="5 1 15" color="red" ></' + au + '>'; var atai = document.getElementById("color") var iro = document.getElementById("background"); iro.style.backgroundColor = atai.value; }