title: How to display the value of select option as response using Node.js
body: <p>I am new to Node.js and Express</p>
  
  <p>I am trying to fetch the selected option from the select list of an HTML page and display as a response using node.js</p>
  
  <p><strong>HTML</strong></p>
  
  <pre><code>&lt;form name="survey" id="survey" method="post" action="/survey"&gt;
      &lt;select name="monthofbirth"&gt;
          &lt;option value="1"&gt;January&lt;/option&gt;
          &lt;option value="2"&gt;February&lt;/option&gt;
          &lt;option value="3"&gt;March&lt;/option&gt;
          &lt;option value="4"&gt;April&lt;/option&gt;
          &lt;option value="5"&gt;May&lt;/option&gt;
          &lt;option value="6"&gt;June&lt;/option&gt;
          &lt;option value="7"&gt;July&lt;/option&gt;
          &lt;option value="8"&gt;August&lt;/option&gt;
          &lt;option value="9"&gt;September&lt;/option&gt;
          &lt;option value="10"&gt;October&lt;/option&gt;
          &lt;option value="11"&gt;November&lt;/option&gt;
          &lt;option value="12"&gt;December&lt;/option&gt;
      &lt;/select&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>Index.JS</p>
  
  <pre><code>var express = require('express')
  var bodyParser = require("body-parser");
  var app = express()
  
  app.use(express.static('public'))
  
  app.use(bodyParser.urlencoded({ extended: false }));
  
  app.post('/survey', function (req, res) {
      let month = req.body.monthofbirth;
  });
  
  app.listen(3000, function () {
      console.log('Example app listening on port 3000!')
  })
  </code></pre>
  
  <p>When I try to print the response using the code res.write(<code>&lt;b&gt;${month}&lt;/b&gt;</code>); It displays the value of the option like 1, 2, 3 etc but I have to display the text like January, February etc.</p>
  
  <p>please help me out with this :(</p>
  
  <p><strong>Edit:</strong></p>
  
  <p>I am not supposed to change the HTML document so I won't be able to change the option values from 1, 2, 3 to January, February etc;</p>