我想在 DOM 中实现一个计时器,但我不想使用任何 Javascript。这真的可能吗?
我已经有了 Javascript 代码,但我想将其更改为 DOM,这样我就不必激活 JS。
感谢您的帮助:D
我想在 DOM 中实现一个计时器,但我不想使用任何 Javascript。这真的可能吗?
我已经有了 Javascript 代码,但我想将其更改为 DOM,这样我就不必激活 JS。
感谢您的帮助:D
The only way to reliably modify the Document Object Model is with JavaScript. DOM is just a structure for accessing parts of a webpage, nothing more.
So unless you have a vendetta against JavaScript and would rather using something like client side VBscript (IE only) you have to use JavaScript.
If you just want to get a similar effect you could try playing with CSS pseudo-elements which I doubt will cover your needs. Also CSS pseudo-elements aren't really part of the page so there are quirks; pseudo-element text cannot be selected for example.
In short, you must use JavaScript to "use" DOM, its a structure, not a language.