By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,693 Members | 1,650 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,693 IT Pros & Developers. It's quick & easy.

edit div content ?

P: n/a
hello

is there a way to edit the content of a div ? for instance to change :

<div>
foo
</div>

into

<div>
ree
</div>

thanks !
Aug 31 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
sorry sorry sorry...
I found that :
http://fr.selfhtml.org/javascript/ob...htm#node_value

it's in french, but the code is quite simple and works as well with a div
as with a p


On Wed, 31 Aug 2005 11:33:07 +0200, toto wrote:
hello

is there a way to edit the content of a div ? for instance to change :

<div>
foo
</div>

into

<div>
ree
</div>

thanks !


Aug 31 '05 #2

P: n/a
toto wrote:
hello

is there a way to edit the content of a div ? for instance to change :

<div>
foo
</div>

into

<div>
ree
</div>

thanks !


Here is an untested example. No idea if it is any good, but it will
probably work.

<div id="DivExample" onmouseover="show('DivExample', 'ree');"
onmouseout="show('DivExample', '&nbsp;');" >&nbsp;</div>

<script type="text/javascript><!--
function show (eln, msg) {
if(document.getElementById) {
var el = document.getElementById(eln);
el.innerHTML = msg;
return true;
}
return false;
}
//--></script>
Aug 31 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.