title: Add JSP Java code to placeholder attribute in HTML
body: <p>I'm trying to make a basic CAPTCHA in JSP by generating two random numbers between 1 and 10 (inclusive) and saying, "What's _ + _?" I started off with this:</p>
  
  <pre><code>&lt;%@ page import="java.util.Random" %&gt;
  &lt;%
      Random r = new Random(); 
      System.out.println(r.nextInt(10) + 1);
  %&gt;
  </code></pre>
  
  <p>That always prints a number between 1 and 10. Now I have this input box:</p>
  
  <pre><code>&lt;input value="" name="text-name" type="text" class="input-2" placeholder="What's _ + _?"&gt;
  </code></pre>
  
  <p>and I want to do something like this:</p>
  
  <pre><code>placeholder="What's " + &lt;% r.nextInt(10)+1 %&gt; + " + " + &lt;% r.nextInt(10)+1 %&gt;
  </code></pre>
  
  <p>But, of course, that's not allowed, so how would you pull this off? Go ahead and use JSP, Java, or Javascript!</p>