在< div>之间更改文字 [英] Changing text between <div>'s

查看:76
本文介绍了在< div>之间更改文字的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

愚蠢的基本问题,但我觉得找到答案非常不可能

其他地方...... :-(


我想要一块在我的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.nu

Stupid basic question but I find it horribly imposible to find the answer
elsewhere... :-(

I want to have a piece of text in my HTML page and want to be able to change
it in a Javascript function that is called from a button. I think I can use
a

<div id="t"></div>

for this ? Something like

document.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 good
intro somewhere ? My thick Oreilly JS book is just too busy with the
complicated stuff somehow :-((

Ton

--
--
Computer museum tonh: http://www.tonh.net/museum - 10.000 visitors !!
GGGallery website generator: http://www.tonh.net/gggallery
Vrij Kunst Centrum : http://www.meesterschap.nu

推荐答案

好的,已经解决了。记得以前我问过这个......


document.getElementById(''t'')。firstChild.nodeValue =" Hello" ;;


令人难以置信的复杂......会寻找这个型号....


谢谢,





-

-

计算机博物馆tonh: http://www.tonh.net/museum - 10.000名访客!!

GGGallery网站生成器: http://www.tonh.net/gggallery

Vrij Kunst Centrum: http://www.meesterschap.nu

" Ton den Hartog <到******** @ tonh.net>在消息中写道

news:3f ********************* @ news.xs4all.nl ...
Ok, already solved it. Remembered I asked this once before....

document.getElementById(''t'').firstChild.nodeValue= "Hello";

Unbelievable how complex.... Will look for the model of this....

Thanks,

Ton

--
--
Computer museum tonh: http://www.tonh.net/museum - 10.000 visitors !!
GGGallery website generator: http://www.tonh.net/gggallery
Vrij Kunst Centrum : http://www.meesterschap.nu
"Ton den Hartog" <to***********************@tonh.net> wrote in message
news:3f*********************@news.xs4all.nl...
愚蠢的基本问题,但我发现在其他地方找到答案非常不可能.......-(

我希望在我的HTML页面中有一段文字,并希望成为能够
在一个从按钮调用的Javascript函数中更改它。我想我可以
使用

< div id =" t">< / div>

这个怎么样?

document.t.value =" Hello"

应该改成

< div id =" t">你好< / div>

我正在疯狂地找到这些简单的东西....有没有
好在某个地方介绍?我厚厚的Oreilly JS书以某种方式忙于复杂的东西: - ((

Ton

-
-
计算机博物馆: http://www.tonh.net/museum - 10.000名访客!!
GGGallery网站生成器: http://www.tonh.net/gggallery < Vrij Kunst Centrum: http://www.meesterschap.nu
Stupid basic question but I find it horribly imposible to find the answer
elsewhere... :-(

I want to have a piece of text in my HTML page and want to be able to change it in a Javascript function that is called from a button. I think I can use a

<div id="t"></div>

for this ? Something like

document.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 good intro somewhere ? My thick Oreilly JS book is just too busy with the
complicated stuff somehow :-((

Ton

--
--
Computer museum tonh: http://www.tonh.net/museum - 10.000 visitors !!
GGGallery website generator: http://www.tonh.net/gggallery
Vrij Kunst Centrum : http://www.meesterschap.nu



为什么这么复杂?为什么DOM没有这么简单的型号????




-

- -

计算机博物馆tonh: http://www.tonh.net /博物馆 - 10.000名访客!!

GGGallery网站生成器: http://www.tonh.net/gggallery

Vrij Kunst Centrum: http://www.meesterschap.nu

" Ton den Hartog" <到******** @ tonh.net>在消息中写道

news:3f ********************* @ news.xs4all.nl ...
Why is this so complex ??? Why does DOM not have an easy model for this ????

Ton

--
--
Computer museum tonh: http://www.tonh.net/museum - 10.000 visitors !!
GGGallery website generator: http://www.tonh.net/gggallery
Vrij Kunst Centrum : http://www.meesterschap.nu
"Ton den Hartog" <to***********************@tonh.net> wrote in message
news:3f*********************@news.xs4all.nl...

document.getElementById(''t'')。firstChild.nodeValue =" Hello" ;;

令人难以置信的复杂程度。 ......会找到这个型号....

谢谢,



-
-
计算机博物馆: http://www.tonh.net/museum - 10.000名访客!!
GGGallery网站生成器: http://www.tonh.net / gggallery
Vrij Kunst Centrum: http://www.meesterschap.nu

" Ton den Hartog" <到******** @ tonh.net>在消息中写道
新闻:3f ********************* @ news.xs4all.nl ...
Ok, already solved it. Remembered I asked this once before....

document.getElementById(''t'').firstChild.nodeValue= "Hello";

Unbelievable how complex.... Will look for the model of this....

Thanks,

Ton

--
--
Computer museum tonh: http://www.tonh.net/museum - 10.000 visitors !!
GGGallery website generator: http://www.tonh.net/gggallery
Vrij Kunst Centrum : http://www.meesterschap.nu
"Ton den Hartog" <to***********************@tonh.net> wrote in message
news:3f*********************@news.xs4all.nl...
愚蠢的基本问题,但我觉得在其他地方找到
答案是非常不可能的...... :-(

我希望在我的HTML页面中有一段文字并希望能够
Stupid basic question but I find it horribly imposible to find the answer elsewhere... :-(

I want to have a piece of text in my HTML page and want to be able to


在一个从按钮调用的Javascript函数中更改


change

它。我想我可以


使用

a

< div id =" t">< / div>

为此?像

document.t.value = 你好

应该改成

< div id =" t">你好< / div>

我是他妈的找到这些简单的东西很生气....有什么
a

<div id="t"></div>

for this ? Something like

document.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


好的

在某处介绍吗?我厚厚的Oreilly JS书太忙了
复杂的东西莫名其妙: - ((


-
-
计算机eum tonh: http://www.tonh.net/museum - 10.000名访客! !GGGallery网站生成器: http://www.tonh.net/gggallery
Vrij Kunst Centrum: http://www.meesterschap.nu
intro somewhere ? My thick Oreilly JS book is just too busy with the
complicated stuff somehow :-((

Ton

--
--
Computer museum tonh: http://www.tonh.net/museum - 10.000 visitors !!
GGGallery website generator: http://www.tonh.net/gggallery
Vrij Kunst Centrum : http://www.meesterschap.nu




On Fri,2003年12月26日12:19:38 +0100,Ton den Hartog

<到*********************** @ tonh.net>写道:
On Fri, 26 Dec 2003 12:19:38 +0100, "Ton den Hartog"
<to***********************@tonh.net> wrote:
为什么这么复杂?为什么DOM没有这个简单的模型????
Why is this so complex ??? Why does DOM not have an
easy model for this ????




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 across
programming languages, I have no idea why that was a design aim, but
it is, this means what can be done simply in typeless scripting
language doesn''t get into the language if it would make the java or
LISP binding more complicated.

It''s often best to use the proprietary methods, as these generally are
optimised for scripting, and only fallback to DOM if they don''t work.

Jim.
--
comp.lang.javascript FAQ - http://jibbering.com/faq/


这篇关于在&lt; div&gt;之间更改文字的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆