I would like to know how to hide a fieldset if the input field is empty. for example in the fieldset MY FORM, if First name and Last Name are both empty, i like to have the whole MY FORM fieldset to be hidden. However, if in the Fieldset MY ADDRESS street is not empty or City is not empty, MY ADDRESS will be shown.

Here is my code:
<!DOCTYPE html>

<form action="">
<legend>MY FORM</legend>
First name: <input type="text" name="firstname"><br>
Last name: <input type="text" name="lastname">


<legend>MY ADDRESS</legend>
Street: <input type="text" name="firstname"><br>
City: <input type="text" name="lastname">