JSFiddle - React, Tailwind, and code Playground
HTML
<div class="first_two_guesses">
<input type="text" class="guess" id='first_guess' placeholder="first guess">
<input type="text" class="guess" id='second_guess' placeholder="second guess">
<button type='button' class="btn-add">Submit</button>
</div>
<div class='word_guesses' style='display: none;'>
<input type='text' class='guess' id='word_or_letter' placeholder='letter or word'>
<button type='button' class='btn-guess'>Submit</button>
</div>
JavaScript
$('.btn-add').on('click', function(){
//... do someting ...
$('.first_two_guesses').hide();
$('.word_guesses').show();
});
$('.btn-guess').on('click', function(){
// ... do the same thing ...
$('.first_two_guesses').show();
$('.word_guesses').hide();
});