我在同一个文档中有两个相同的事件,但只有一个有效,另一个无效。此代码显示相同的 ID,这是一个愚蠢的疏忽,我使用了不同的 ID,但无济于事。
如何使用 $(this) 来影响这两个事件?
这是我的代码。
<fieldset class="clear">
<div class="auth_98">
<legend>Is this a conference?</legend>
<input class="authradio" type="radio" name="conf" id="confyes" value="yes">
<label>Yes</label>
<input class="authradio" type="radio" name="conf" value="no" checked="checked">
<label>No</label>
<!-- begin Conference Toggle -->
<script>
$(document).ready(function() {
$('.hideme').hide()
$('.authradio').change(function() {
var $stat = $('#confyes')[0].checked;
if ($stat == true) $('.hideme').slideDown();
else $('.hideme').slideUp();
});
});
</script>
<!-- end Conference Toggle -->
<!-- hidden conference section -->
<div class="hideme">
<div class="auth_50">
<legend>Conference Role</legend>
<input class="authradio" type="radio" name="conference" value="Atendee" checked="checked">
<label>Attendee</label>
<input class="authradio" type="radio" name="conference" value="Presenter">
<label>Presenter</label>
<input class="authradio" type="radio" name="conference" value="invitedspeaker">
<label>Invited Speaker</label>
</div>
<div class="auth_50">
<label>
<legend>Conference Website</legend>
</label>
<input class="authurl" type="url" placeholder="www.amazingsciencestuff.com">
</div>
</div>
</div>
</fieldset>