本文介绍了在< div>之间更改文字的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 愚蠢的基本问题,但我觉得找到答案非常不可能 其他地方...... :-( 我想要一块在我的HTML页面中的文本,并希望能够在一个从按钮调用的Javascript函数中更改 。我想我可以使用 a < div id =" t">< / div> for this? document.t.value =" Hello" 应将其更改为 < div id =" t"> ;你好< / div> 我正在疯狂地找到这些简单的东西......在某处有一个很好的 介绍吗?我厚厚的奥利利JS书太忙了以某种方式复杂的东西: - (( 吨 - - 计算机博物馆tonh: http://www.tonh.net/museum - 10.000名访客!! GGG allery网站生成器: http://www.tonh.net/gggallery Vrij Kunst Centrum: http://www.meesterschap.nuStupid basic question but I find it horribly imposible to find the answerelsewhere... :-(I want to have a piece of text in my HTML page and want to be able to changeit in a Javascript function that is called from a button. I think I can usea<div id="t"></div>for this ? Something likedocument.t.value="Hello"should change it into<div id="t">Hello</div>I am getting fucking mad at finding these simple things.... Is there a goodintro somewhere ? My thick Oreilly JS book is just too busy with thecomplicated stuff somehow :-((Ton----Computer museum tonh: http://www.tonh.net/museum - 10.000 visitors !!GGGallery website generator: http://www.tonh.net/gggalleryVrij Kunst Centrum : http://www.meesterschap.nu推荐答案 在一个从按钮调用的Javascript函数中更改 change 使用 好的 DOM不是设计得很简单它的设计是为了保持一致 编程语言,我不知道为什么这是一个设计目标,但 它是,这意味着可以简单地在无类型脚本中完成什么 语言不会进入语言,如果它会使java或 LISP绑定更复杂。 通常最好是使用专有方法,因为这些方法通常都是针对脚本进行优化的,只有在不工作时才会回退到DOM。 Jim。 - comp.lang.javascript常见问题 - http://jibbering.com/faq/DOM is not designed to be simple it''s designed to be consistent acrossprogramming languages, I have no idea why that was a design aim, butit is, this means what can be done simply in typeless scriptinglanguage doesn''t get into the language if it would make the java orLISP binding more complicated.It''s often best to use the proprietary methods, as these generally areoptimised for scripting, and only fallback to DOM if they don''t work.Jim.--comp.lang.javascript FAQ - http://jibbering.com/faq/ 这篇关于在< div>之间更改文字的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云! 08-31 02:15