Input and button in one parent can do that or not?

If instead of such code:
<nav class="navbar navbar-inverse navbar-fixed-top">
 <form id="my_form" class="navbar-form navbar-left" role="search">
 <div class="form-group">
 <input type="text" class="form-control" placeholder="Search">
</div>
 <button type="submit" class="btn btn-default">Submit</button>
</form>
 </nav>


To do this:

<nav class="navbar navbar-inverse navbar-fixed-top">
 <form id="my_form" class="navbar-form navbar-left" role="search">
 <div class="form-group">
 <input type="text" class="form-control" placeholder="Search">
 <button type="submit" class="btn btn-default">Submit</button>
</div>
</form>
 </nav>


What is bad?
July 8th 19 at 16:23
2 answers
July 8th 19 at 16:25
If you really need this implementation, there is nothing wrong in this.
July 8th 19 at 16:27
Nothing wrong with that. Preference for one option or the other may be determined by circumstantial factors (design; some specific handlers hanging on the form; the tastes of the developer).

Find more questions by tags HTMLBootstrapCSS