为什么结果不确定?

时间:2018-08-12 14:39:30

标签: javascript html5 css3

为什么Statement s = connection.createStatement(); s.execute("drop all objects delete files"); result

我的代码

undefined
var radios = document.querySelectorAll('input[type=radio]');
var result = document.querySelector('.result');
var a;

for (var i = 0; i < radios.length; i++) {
  radios[i].addEventListener('change', function() {
    a = this.dataset.number;
  });
}
result.innerHTML = a;

JavaScript

<input type="radio" name="r" data-number="2" value="Radio 1">Radio 1
<input type="radio" name="r" data-number="4" value="Radio 2">Radio 2
<input type="radio" name="r" data-number="8" value="Radio 3">Radio 3

<div class="result">Result</div>

任何帮助我都会很高兴

0 个答案:

没有答案