0

这个玉有什么问题?谢谢。

input#a
h1= document.getElementById('a').value

给出的错误是空白的。

4

1 回答 1

1

As Amberlamps suggests, you have to wait until the DOM is ready.

input#a
h1

//- presuming you are using jQuery
script
    $(function() {
        $('h1').html($('input#a').val());
    });
于 2013-06-11T23:25:53.140 回答