JSFiddle - React, Tailwind, and code Playground
HTML
<div class="access othertab" id="roomopts-access">
<h1>Sicurezza</h1>
<p>Qui puoi decidere la modalitĂ di accesso alla stanza, proteggendola da eventuali visitatori indesiderati.</p>
<br />
<input type="radio" name="roomdoor" id="open" class="radio" checked/>
<label for="open" class="radio-label">Aperta</label>
<br />
<input type="radio" name="roomdoor" id="doorbell" class="radio" />
<label for="doorbell" class="radio-label">Chiusa a chiave (Campanello)</label>
<br />
<input type="radio" name="roomdoor" id="password" class="radio checkdisplay" />
<label for="password" class="radio-label">Lucchetto (Password)</label>
<div class="roompass todisplay">
<label>Password stanza <span class="little">(solo se selezioni "Lucchetto")</span>
<input type="text" id="roompass" />
</label>
<label>Ripeti password
<input type="text" id="roompass" />
</label>
</div>
</div>
CSS
.access .roompass {
display: none;
}
JavaScript
$(document).ready(function(){
$('.radio').change(function(){
if($(this).hasClass('checkdisplay') && this.checked)
$('.todisplay').fadeIn('slow');
else
$('.todisplay').fadeOut('slow');
});
});