-1
为什么我不能getElementByName?html js append和getElementByName
<form class="form" action="#">
<p class="EmptySlot" hidden>
<input name="characters" type="radio" id="empty" disabled="disabled"/>
<label for="empty">Пустой слот</label>
</p>
</form>
然后:
$(".form").append('\
<p>\
<input name="character" type="radio" id="' + notformatname + '" value="' + notformatname + '"/>\
<label for="' + notformatname + '" id="charlabel">' + formatname + '</label>\
</p>');
而且它不工作:
var radios = document.getElementsByName('character');
作品对我蛮好 –
你甚至尝试访问检索节点列表的元素呢?此外,你需要更具体的比_it不工作。 –
你包含jQuery库吗? –