epoch转换器的工作已经完成,但是当我通过id得到span的值并将其复制到broser时给我未定义
<span name ="EpochClock" id="EpochClock"></span>
</div>
<input type="button" onClick="pprint()" value="print" >
<script language="JavaScript">
function pprint(){
// If you want to use element Id
var a = document.getElementById('EpochClock').value;
document.write(a);
// If you want to access by element name
var b = document.getElementsByName('EpochClock')[0].value;
document.write(b);
}
</script>
任何帮助