title: how to check the check-box if it's value is exist in a text-area
body: <p>I have some check-box and one text-area, and a collect all the check-boxes value in a text-area and then insert it in database, when I select data from database, I just have data for the text-area not for check-boxes. the things that I want is: the check-boxes which i checked before must be checked when I view them. now how I can check if the value of check-box is exist in text-area then check the box? my code is here?</p>
  
  <pre><code>                       &lt;div style="margin-top:50px;"&gt;
                              &lt;div style="margin-top:-30px;"&gt;
                                  &lt;h4&gt;Header Options&lt;/h4&gt;&lt;br&gt;
                                  &lt;table style="width:70%;float:left"&gt;
                                      &lt;tbody&gt;
                                          &lt;tr&gt;
                                              &lt;td&gt;&lt;input type="checkbox" id="h_option1" name="h_option1" value="Company Name"&gt; Company Name &lt;/td&gt;
                                              &lt;td&gt;&lt;input type="checkbox" id="h_option2" name="h_option2" value="Company Address"&gt; Company Address&lt;/td&gt;
                                              &lt;td&gt;&lt;input type="checkbox" id="h_option3" name="h_option3" value="Month"&gt; Month&lt;/td&gt;
                                              &lt;td&gt; &lt;input type="checkbox" id="h_option4" name="h_option4" value="Name"&gt; Name &lt;/td&gt;
                                          &lt;/tr&gt;
                                          &lt;tr&gt;
                                              &lt;td&gt; &lt;input type="checkbox" id="h_option5" name="h_option5" value="Employee Ref No"&gt; Employee Ref No &lt;/td&gt;
                                              &lt;td&gt;&lt;input type="checkbox" id="h_option6" name="h_option6" value="Designation"&gt; Designation &lt;/td&gt;
                                              &lt;td&gt;&lt;input type="checkbox" id="h_option7" name="h_option7" value="Date of joining"&gt; Date of joining &lt;/td&gt;
                                          &lt;/tr&gt;
                                      &lt;/tbody&gt;
                                  &lt;/table&gt;
                                  &lt;div&gt;
                                      &lt;span&gt;
                                          &lt;textarea readonly="" type="text" id="header_options" name="header_options" rows="5" cols="25"&gt;Company Name,Company Address,Month,Employee Ref No,&lt;/textarea&gt;
                                      &lt;/span&gt;
                                  &lt;/div&gt;
                              &lt;/div&gt;
                              &lt;br&gt;
                              &lt;br&gt;
                              &lt;div align="center"&gt;
                                  &lt;input type="button" value="Configure" class="detailsbutton" onclick="get_check_value();"&gt;
                              &lt;/div&gt;
                              &lt;br&gt;
                          &lt;/div&gt;
  </code></pre>
  
  <p>the result which i expect is:
  <img src="https://i.stack.imgur.com/CFZmz.png" alt="the expected result">
  but it gives me the following result:
  <img src="https://i.stack.imgur.com/klMRh.png" alt="the current result"></p>
  
  <p>NOTE: I separate each value of check-box with a comma inside the text-area.</p>