两个选择标签。 首先得到父类别,第二个想要获得每个类别的孩子,这取决于选择哪个父母

I have only the first select up and running. Need help for the second. Can it be done only with PHP or it requires javascript or ajax? I'm using Wordpress btw.

function sellers_area_selection()
{
  $args = array(
   'post_type' => 'seller',
   'taxonomy'  => 'nomos',
   'hide_empty'=> 0,
   'parent'    => 0
  );

  $categories = get_categories( $args );

  if ( $categories ) {
  echo '<select id="nomoi-select">';
    echo '<option selected="" disabled="" value="0"><span>Νομοί</span></option>';

    foreach ($categories as $category) {
      $id = $category->term_id;
      $name = $category->name;
      echo '<option class="nomos" id="'. $id .'">'. $name .'</option>';
    }
  echo '</select>';
  }
}