homepage Welcome to WebmasterWorld Guest from 54.167.41.199
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

    
Calculate values in <div>
Calculate values in <div>
deian




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

hi

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 :(

 

dave_f




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

Hi

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

DrDoc




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

Welcome to Webmaster World, both of you! :)

Glad to have ya! ;)

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved