I'm changing either a text box representing the Hours in time or Minutes in time depending which text box currently has focus...
So basically I'm trying to change the value of a text field depending on weather or not it has focus...but for the life of me I can't figure out how to determine this.
My simple code so far:
Expand|Select|Wrap|Line Numbers
- <script type='text/javascript'>
- function Up(MinTextBox, HrTextBox)
- {
- ----------->if(document.getElementById(MinTextBox).......has focus?
- {
- document.getElementById(MinTextBox).value = Number(document.getElementById(MinTextBox).value) +1
- }
- else
- {
- document.getElementById(HrTextBox).value = Number(document.getElementById(HrTextBox).value) +1
- }
- }
- </script>
-Frinny