Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

html paragraph variable with javascript array

how can I insert an element from a array of strings into a paragraph tag and then increment it later to show the next element in the array?
ex:
Code
<INPUT type="button" value="Submit" name="button1" onClick="strcmp(textbox.text,L_Answers[x])"> // function to compare //strings will return true or false
<FORM>
<INPUT TYPE="text"NAME="list"
SIZE="40"
MAXLENGTH="35">
</FORM> // textbox
<script>
var L_allLinks = new Array (
's1' , "TExt here this is L_allLinks[0]",
's2' ,"This is the next element need to output this to the page somehow");
for(x = 0;x <20 ;){
  <p>L_allLinks[x]</p> // this is pseudo code for what I want to do
if(button1.val == false)
   alert("You got it wrong");
else
  alert("Goodjob!\n");
  x++;} // increment what the paragraph displays
</script>

something along the lines of that
the only problems I have is scope , and the aforementioned displaying the text depending on what L_allLinks[x] is.


Possibly Related Threads...
Thread / Author Replies Views Last Post
by priluxDec 10, 2016 11:18 AM 1 239 Dec 10, 2016 11:18 AM
Last Post: VirtualFrost
by ApexDexterityOct 22, 2016 11:38 AM 3 104 Oct 22, 2016 11:38 AM
Last Post: Rushax
by gabrielchihongleeJan 19, 2016 03:00 AM 7 498 Jan 19, 2016 03:00 AM
Last Post: gabrielchihonglee