如何更改显示的文字? [英] How can I change displayed text?

查看:61
本文介绍了如何更改显示的文字?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



伙计,


假设我有一张桌子,十列,十行 - 每个都有一个单词。我希望

通过超链接更改表格中部分/全部单元格的值。

如何引用每个单元格并从链接更改其文本内容

页面的其他地方?我有一个想法,我需要在我的< td>中找到类似

''id''的东西。虽然我对服务器端有更深入的理解,但是对PHP这样的编程语言来说,javascript对我来说仍然是一个新手。


有人可以帮忙吗?我正在学习越来越多关于文档属性的内容所以

如果有人可以给我一个快速的例子(带一些评论

语句)它应该给我足够的玩法和教育自己(因为

反对提供完整的答案而我学得很少)。


所有帮助,通过新闻组,非常感谢,谢谢,

randelld


Folks,

Say I have a table, ten columns, ten rows - Each with a word in it. I want
to change the values of some/all of the cells in the table via a hyperlink.
How do I reference each cell and change its text contents from a link
elsewhere in the page? I have a rought idea that I''ll need something like
''id'' in my <td> tags but while I have a greater understanding of server-side
programming langauges like PHP, javascript is still very new to me.

Can someone help? I am learning more and more about document properties so
if someone could provide me with a quick example (with some remark
statements) it should give me enough to play with and educate myself (as
opposed to providing the full answer and I learn little).

All help, via the newsgroup, is much appreciated, thanks,
randelld

推荐答案



"通过新闻组回复 <再***************** @ shaw.ca>在消息中写道

news:76AUb.409681

"Reply Via Newsgroup" <re*****************@shaw.ca> wrote in message
news:76AUb.409681


ts4.206091@pd7tw3no ...
ts4.206091@pd7tw3no...

伙计,

说我有一张桌子,十列,十行 - 每个都有一个单词。 I
想要通过
超链接更改表格中部分/全部单元格的值。如何引用每个单元格并从页面中其他位置的链接更改其文本内容?我有一个想法,我需要在我的< td>中找到像
'id''这样的东西。虽然我对PHP这样的
服务器端编程语言有了更深入的了解,但javascript对我来说还是一个新手。

有人可以帮忙吗?我正在学习越来越多关于文档属性的知识,所以如果有人可以给我一个快速的例子(带有一些评论
语句),它应该给我足够的玩法和教育自己(如
反对提供完整的答案,我学到的很少。

所有帮助,通过新闻组,非常感谢,谢谢,
randelld

Folks,

Say I have a table, ten columns, ten rows - Each with a word in it. I want to change the values of some/all of the cells in the table via a hyperlink. How do I reference each cell and change its text contents from a link
elsewhere in the page? I have a rought idea that I''ll need something like
''id'' in my <td> tags but while I have a greater understanding of server-side programming langauges like PHP, javascript is still very new to me.

Can someone help? I am learning more and more about document properties so
if someone could provide me with a quick example (with some remark
statements) it should give me enough to play with and educate myself (as
opposed to providing the full answer and I learn little).

All help, via the newsgroup, is much appreciated, thanks,
randelld




如果我的原始问题可能不够清楚,我很害怕 -

因此...如果有人可以提供一个简单的文本示例table

cell ...以及单击时单独链接,将更改表格单元格中保存的文本(而不是

图像)...


再次,所有帮助,通过新闻组得到了很多鼓励

randelld



I''m afraid in case my original question might not have been clear enough -
thus... if someone could supply me with a simple example of text in a table
cell... and a seperate link that when clicked, will change the text (not the
image) held in the table cell...

again, all help, via newsgroup is much apprecaited
randelld


Randell D.于2004年6月6日写道在comp.lang.javascript中
Randell D. wrote on 06 feb 2004 in comp.lang.javascript:
我很害怕我的原始问题可能不清楚
en ough - 因此...如果有人可以在表格单元格中提供一个简单的
文本示例...并且单击时会单独链接,将更改所持有的文本(而不是图像)在表格单元格中......
I''m afraid in case my original question might not have been clear
enough - thus... if someone could supply me with a simple example of
text in a table cell... and a seperate link that when clicked, will
change the text (not the image) held in the table cell...




< table>< tr>< td id =" cell43">

原文

< / td>< / tr>< / table>


<按钮

onclick = " document.getElementById(''cell43'')。innerHT ML =

''新单词''">

更改单元格43< / button>

-

Evertjan。

荷兰。

(请将x''改为我的点数emailaddress)



<table><tr><td id="cell43">
Original text
</td></tr></table>

<button
onclick="document.getElementById(''cell43'').innerHT ML=
''New words''">
Change cell 43</button>
--
Evertjan.
The Netherlands.
(Please change the x''es to dots in my emailaddress)


这篇关于如何更改显示的文字?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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