Fügen Sie das Sternchenfeld in JS hinzu

<label class="required">Name:</label>
<input type="text">

<style>
  .required:after {
    content:" *";
    color: red;
  }
</style>
Curious Cassowary