且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

实时服务器时钟

更新时间:2023-02-26 17:38:16


...< form name =" live_time_form">

服务器时间:< ; INPUT TYPE =" text"名称= QUOT; live_time_clock&QUOT; size =" 15">

< / form> ...
...<form name="live_time_form">
Server Time: <INPUT TYPE="text" name="live_time_clock" size="15">
</form>...



而不是尝试使用


a span或具有相同名称的div(=live_time_clock)

它应该工作

instead try using

a span or a div with the same name (="live_time_clock")
it should work



所以我想替换document.live_time_form.live_time_clock.value行,以及我的< form>一些简单的< p>或者其他的东西?
So I want to replace the document.live_time_form.live_time_clock.value line, and also my <form> to some simple <p> or something?



将表格替换成id为live_time_clock的div / span / p / other元素然后用以下代码替换line4:

Replace the form with a div/span/p/other element with id "live_time_clock" and then replace line4 with:

展开 | 选择 | Wrap | 行号



而不是尝试使用


a span或具有相同名称的div(=live_time_clock)

它应该工作
instead try using

a span or a div with the same name (="live_time_clock")
it should work



你是沿着正确的方向行,但是adiv / span没有值属性,所以你需要使用innerHTML或DOM方法。

You''re along the right lines, but adiv/span doesn''t have a value attribute, so you''d need to use innerHTML or the DOM methods.