Welcome to WebmasterWorld Guest from

Forum Moderators: open

Message Too Old, No Replies

Calculate values in <div>

Calculate values in <div>



8:14 am on Dec 15, 2003 (gmt 0)

Inactive Member
Account Expired



i'm trying to calculate some values in <div>, based on user interraction.

<div id="one">3</div>
<img src="sample.jpg" alt="" width="170" height="120" onclick="this.document.getElementById("one").value++">

but this is not working :(

4:11 pm on Dec 15, 2003 (gmt 0)

New User

10+ Year Member

joined:Dec 15, 2003
votes: 0


Try onclick='document.getElementById("one").firstChild.nodeValue++;'. This should work.

4:13 pm on Dec 15, 2003 (gmt 0)

Senior Member

WebmasterWorld Senior Member drdoc is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Mar 15, 2002
votes: 0

Welcome to Webmaster World, both of you! :)

Glad to have ya! ;)