I have this code:
<ul>
<li><a href="#" class="service-chooser" id="ubuntu-one">Ubuntu One</a></li>
<li><a href="#" class="service-chooser" id="ftp">FTP account</a></li>
</ul>
<!-- these div are hidden -->
<div id="ubuntu-one-form" class="hide">
Ubuntu One credential
</div>
<div id="ftp-form" class="hide">
Ftp Crediental
</div>
when i click on a link i want to show a div based on the id of the link:
<script type="text/javascript">
$(document).ready(function() {
$(".service-chooser").click(function() {
var service = $(this).attr('id');
var service-id = '#' + service + 'form';
$(service-id).show('slow', function() {
// Animation complete.
});
});
});
</script>
But it doesn't work