-7

I am creating a website in HTML and have a form that asks for the users email to get weekly emails and I need help on how to collect all of the emails in one spot. I am a beginner coder.

this is my code for the form:

<div style="text-align:right;">
<form name="email">
<p>Enter your email to get weekly referee tips.</p>
Email<input type="text" name="email"/>
<input type="button" onclick="list" value="enter"/>
</div>
<script>
List<String> list = new ArrayList<>();
int listSize = list.size();
for(int i = 0; i < listSize; ++i)
list.add("Email");
</script>
esqew
  • 42,425
  • 27
  • 92
  • 132

1 Answers1

0

First of all your array size is 0 at first so that for loop never runs. Also, that is Java not Javascript. This would be the correct way to do so in Javascript:

var i;
var list = [];

for(i = 0 ; i < ??? ; i++) {
    list.push("email");
}
jongusmoe
  • 676
  • 4
  • 16