Javascript 在按钮上显示非唯一div类单击jquery
我想显示的div类。在一个按钮按下时取消提示。此类是动态生成的,因此有多个具有相同类名的div。使用JQuery如何正确显示此块Javascript 在按钮上显示非唯一div类单击jquery,javascript,jquery,html,Javascript,Jquery,Html,我想显示的div类。在一个按钮按下时取消提示。此类是动态生成的,因此有多个具有相同类名的div。使用JQuery如何正确显示此块 <div id="negativeButtons"> <div class="unhideme" name="unhideme" style="display:none"> <h3>Comments</h3> <textarea name="unhappymanager" id="unhappymanag
<div id="negativeButtons">
<div class="unhideme" name="unhideme" style="display:none">
<h3>Comments</h3>
<textarea name="unhappymanager" id="unhappymanager"></textarea>
</div>
<input type="submit" class="excused" name="negativexcused" value="Excused">
<input type="button" class="unexcused" name="unexcused" value="Unexcused">
<input type="submit" class="commentpushDB" name="commentpushDB" style="display:none" value="Submit">
</div>
相反,您必须使用
.sides()
方法:
$(".unexcused").click(function() {
$(this).siblings(".unhideme").show();
$(this).siblings(".unexcused").hide(); // <---- ?? why hide the buttons.
$(this).prev(".excused").hide();
$(this).next(".commentpushDB").show();
});
$(“.unexecuted”)。单击(函数(){
$(this.sides(“.unhideme”).show();
$(this.sides(“.unexecuted”).hide()//
$(".unexcused").click(function() {
$(this).siblings(".unhideme").show();
$(this).siblings(".unexcused").hide(); // <---- ?? why hide the buttons.
$(this).prev(".excused").hide();
$(this).next(".commentpushDB").show();
});