Create Hide/Unhide Function

Hi, i am trying to create a function like this one on the website:

in the search on the left where it says ‘how many rooms’ - when you select the drop down and pick 2 rooms a new row automatically appears, can anyone tell me what this function is called or kind enough to help me build this function as i need it for my website.