What I have here is part of a larger project, but I have tried to isolate my current issue by stripping out the rest of the program to just show the current issue. There may be a couple of remnants of other stuff remaining, that in the current setting do not do anything, but are used in the full program.
What I am currently trying to do with what is shown below is as follow:
1/ When I click on a number in the lower display, it should show in the upper display under new number. This does operate fine as it should.
2/ When the next number is clicked on, I would like to see the prior number show up in the prior number section. This does not work.
I am assuming that this can be done by creating a blank array (myARR) with javascript, adding the new value of the next clicked number to the array and then reading the prior number that would then be in the second position of the array?
3/ I would also like to keep a running count of numbers clicked on. Also not working.
I am assuming that this could be accomplished by using the javascript length property on the array.
I think I have a rough idea of the processes (but I may be wrong), but I am having a devil of a time trying to get the coding to work, thank you. The alert window response will not be in the end product, as I am just using it currently to get a response that I can see and work from, but all I am getting is undefined.
Thanking anyone for their assistance,
Stan
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD>
<script type='text/javascript'
src='jquery-1.3.2.min.js'></script>
<script type="text/javascript">
</HEAD>
<script type='text/javascript'
src='jquery-1.8.3.js'></script>
<BODY STYLE="background-color: yellow" >
<TABLE width="100%" border="1" >
<TR>
<script type="text/javascript">
function reply_click(clicked_id)
{
//alert(clicked_id);
//document.write(clicked_id);
document.getElementById("clicked_id").innerHTML = clicked_id;
let myARR = clicked_id[12];
//document.write(myArr[0]);
//var clicked_id = pmARR(2);
//var myARR = [clicked_id];
//myARR = clicked_id;
//var (clicked_id) = pmAAA[];
//var clicked_id = myARR[2];
//myARR.push(clicked_id);
//console.log(myARR[0,5]);
alert (myARR);
//alert(myARR);
//document.writeln((i+1) + ": " + myARR[i]);
}
</script>
<TD><CENTER>
<B>
<B>NEW NUMBER</b><BR>
<span style="font-size: 89px" id="clicked_id"></span>
<HR width="100%">
<B>Prior Number</b><BR>
<Script>
console.log(myARR().value);
</script>
<HR width="100%">
<B>How Many Numbers Picked</b><BR>
<SCRIPT>
myARR.length:
</script>
</center>
<FORM NAME="numbers">
<TABLE WIDTH="100%" CELLPADDING="0" CELLSPACING="0" >
<P>
<TR><TD COLSPAN="3">
<!-- numbers table -->
<TABLE WIDTH="100%" BORDER="1" CELLPADDING="0" CELLSPACING="1" STYLE="background-color: #0080FF; font-size: x-large; font-family: sans-
serif; font-weight: 900; text-align: center" bgcolor=#0080FF>
<TR>
<TD button id="01" onClick="reply_click(this.id);ManualColorBlue(this);" ondblclick="ManualColorBACK(this)"><BIG>1</button>
<TD button id="02" onClick="reply_click(this.id);ManualColorBlue(this);" ondblclick="ManualColorBACK(this)"><BIG>2</button>
<TD button id="03" onClick="reply_click(this.id);ManualColorBlue(this);" ondblclick="ManualColorBACK(this)"><BIG>3</button>
<TD button id="04" onClick="reply_click(this.id);ManualColorBlue(this);" ondblclick="ManualColorBACK(this)"><BIG>4</button>
<TD button id="05" onClick="reply_click(this.id);ManualColorBlue(this);" ondblclick="ManualColorBACK(this)"><BIG>5</button>
<TD button id="06" onClick="reply_click(this.id);ManualColorBlue(this);" ondblclick="ManualColorBACK(this)"><BIG>6</button>
<TD button id="07" onClick="reply_click(this.id);ManualColorBlue(this);" ondblclick="ManualColorBACK(this)"><BIG>7</button>
<TD button id="08" onClick="reply_click(this.id);ManualColorBlue(this);" ondblclick="ManualColorBACK(this)"><BIG>8</button>
<TD button id="09" onClick="reply_click(this.id);ManualColorBlue(this);" ondblclick="ManualColorBACK(this)"><BIG>9</button>
<TD button id="10" onClick="reply_click(this.id);ManualColorBlue(this);" ondblclick="ManualColorBACK(this)"><BIG>10</button>
<TD button id="11" onClick="reply_click(this.id);ManualColorBlue(this);" ondblclick="ManualColorBACK(this)"><BIG>11</button>
<TD button id="12" onClick="reply_click(this.id);ManualColorBlue(this);" ondblclick="ManualColorBACK(this)"><BIG>12</button>
</TD></TR></TABLE>
<!-- end numbers table -->
</TABLE>
</FORM>
</BODY>
</HTML>