LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 06-08-2005, 11:04 AM   #1
LinuxLala
Senior Member
 
Registered: Aug 2003
Location: New Delhi, India
Distribution: Fedora 7
Posts: 1,305

Rep: Reputation: 45
Javasript to count number of mouse clicks


Hi

I am in a fix. I need to create a Javascript function that keeps track of the number of times a mouse is clicked over a button. No problem. this is done. Next, I would like to print this value. How can I print this value. Also, how do I get it to update the printed value when the mouse is clicked.

Is this possible? OR, should I just let them click on the button as many times as they wish and then they click on another button and the value gets printed.

Please help, I am clueless in either case
 
Old 06-08-2005, 12:38 PM   #2
jonaskoelker
Senior Member
 
Registered: Jul 2004
Location: Denmark
Distribution: Ubuntu, Debian
Posts: 1,524

Rep: Reputation: 46
Quote:
How can I print this value
One idea: but the value into a named <input>, and update its value.

Or use <span id="foo">0</span> and update its contents, either by use of innerHTML or some DOM hackery.

In the code that gets called every time the user clicks the button (doesn't that include clicks by a non-mouse device?), call the function that updates the output `thing'.

hth --Jonas
 
Old 06-17-2005, 12:58 AM   #3
LinuxLala
Senior Member
 
Registered: Aug 2003
Location: New Delhi, India
Distribution: Fedora 7
Posts: 1,305

Original Poster
Rep: Reputation: 45
thanks jonaskoelker. I shall look into it.
 
Old 06-17-2005, 01:23 AM   #4
jonaskoelker
Senior Member
 
Registered: Jul 2004
Location: Denmark
Distribution: Ubuntu, Debian
Posts: 1,524

Rep: Reputation: 46
yw
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
random mouse clicks SuSE 9.3 MichaelLange Linux - Hardware 3 03-09-2006 06:10 PM
count total number of lines in several files xushi Programming 5 11-12-2005 05:42 PM
How to capture clicks from mouse to a file floydigus Linux - Hardware 2 07-02-2005 02:40 AM
Simulated mouse clicks in linux? devilkin Programming 2 02-14-2005 08:59 AM
Count number of line in a file. philipina Programming 7 03-18-2004 06:04 PM


All times are GMT -5. The time now is 12:15 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration