Javascript 如何同时单击一个按钮和激活的两个按钮

Javascript 如何同时单击一个按钮和激活的两个按钮,javascript,jquery,html,css,Javascript,Jquery,Html,Css,您好,我正在编写一个多步骤表单,我的jquery脚本使用fieldset标记将表单分割成不同的部分,所以一切都很好 </section1> <input type="button" class='hidden_button' style='display:none' value="Próximo" /> <div class="row"> <header1> <input t

您好,我正在编写一个多步骤表单,我的jquery脚本使用fieldset标记将表单分割成不同的部分,所以一切都很好

</section1>
    <input type="button" class='hidden_button' style='display:none'  value="Próximo" />
       <div class="row">
                    <header1>
  <input type="button" name="Next" id='button1' class="next action-button "  value="Próximo"/>
                    </header1>
<script type="text/javascript">                     
$('#button1').click(function()
{ 
 $('.hidden_button').show();
});</script>

but still with no success`
我需要一个代码,如果单击一个按钮同时激活另一个隐藏的按钮,因为正如我提到的jquery将我的表单拆分为不同的部分,例如:

</section1>
    <input type="button" class='hidden_button' style='display:none'  value="Próximo" />
       <div class="row">
                    <header1>
  <input type="button" name="Next" id='button1' class="next action-button "  value="Próximo"/>
                    </header1>
<script type="text/javascript">                     
$('#button1').click(function()
{ 
 $('.hidden_button').show();
});</script>

but still with no success`
如果/fieldset标记而不是fieldset>另一个表单开始,并且我的表单中有页眉和页脚标记,那么如果我单击“下一步”按钮并将该按钮放置在页脚标记内,则只会更改页脚容器

</section1>
    <input type="button" class='hidden_button' style='display:none'  value="Próximo" />
       <div class="row">
                    <header1>
  <input type="button" name="Next" id='button1' class="next action-button "  value="Próximo"/>
                    </header1>
<script type="text/javascript">                     
$('#button1').click(function()
{ 
 $('.hidden_button').show();
});</script>

but still with no success`
因此,如果我在字段集中放置另一个按钮,然后按下它,它就可以正常工作了,但是我想把按钮放在页脚中,以便美观

</section1>
    <input type="button" class='hidden_button' style='display:none'  value="Próximo" />
       <div class="row">
                    <header1>
  <input type="button" name="Next" id='button1' class="next action-button "  value="Próximo"/>
                    </header1>
<script type="text/javascript">                     
$('#button1').click(function()
{ 
 $('.hidden_button').show();
});</script>

but still with no success`
ieda将把按钮隐藏在fieldset标记内,并将其与页脚标记内的按钮链接。这里的任何想法都是我的代码。提前谢谢

      <section1>
    <label class="checkbox"><input type="checkbox" name="copy"><i></i><strong>Send a copy to my e-mail address</strong></label>
</section1>

<input type='button' name="Next" class='next action-button' value='Próximo' />
 <div class="row">
    <header1>
        <input type='button' name='Next' class='next action-button' value='Próximo' />
    </header1>
</div>
</fieldset>
</section1>
    <input type="button" class='hidden_button' style='display:none'  value="Próximo" />
       <div class="row">
                    <header1>
  <input type="button" name="Next" id='button1' class="next action-button "  value="Próximo"/>
                    </header1>
<script type="text/javascript">                     
$('#button1').click(function()
{ 
 $('.hidden_button').show();
});</script>

but still with no success`

将副本发送到我的电子邮件地址
脚本:在此链接中查看js部分:

</section1>
    <input type="button" class='hidden_button' style='display:none'  value="Próximo" />
       <div class="row">
                    <header1>
  <input type="button" name="Next" id='button1' class="next action-button "  value="Próximo"/>
                    </header1>
<script type="text/javascript">                     
$('#button1').click(function()
{ 
 $('.hidden_button').show();
});</script>

but still with no success`
我试过这个

</section1>
    <input type="button" class='hidden_button' style='display:none'  value="Próximo" />
       <div class="row">
                    <header1>
  <input type="button" name="Next" id='button1' class="next action-button "  value="Próximo"/>
                    </header1>
<script type="text/javascript">                     
$('#button1').click(function()
{ 
 $('.hidden_button').show();
});</script>

but still with no success`

$('#按钮1')。单击(函数()
{ 
$('.hidden_button').show();
});
但仍然没有成功`

给他们一个ID,并使用jQuery的单击功能

</section1>
    <input type="button" class='hidden_button' style='display:none'  value="Próximo" />
       <div class="row">
                    <header1>
  <input type="button" name="Next" id='button1' class="next action-button "  value="Próximo"/>
                    </header1>
<script type="text/javascript">                     
$('#button1').click(function()
{ 
 $('.hidden_button').show();
});</script>

but still with no success`

$('#button1')。单击(函数(){$('#button2')。单击()

为元素同时提供一个类而不是一个id,因为它代表一个元素而不是多个元素,因此我们制作:

</section1>
    <input type="button" class='hidden_button' style='display:none'  value="Próximo" />
       <div class="row">
                    <header1>
  <input type="button" name="Next" id='button1' class="next action-button "  value="Próximo"/>
                    </header1>
<script type="text/javascript">                     
$('#button1').click(function()
{ 
 $('.hidden_button').show();
});</script>

but still with no success`
<input type='button' id='button1' />
<input type='hidden' class='hidden_button' />
<input type='hidden' class='hidden_button' />
$('#button1').click(function()
{ 
 $('.hidden_button').attr('type','button');
});

$('#按钮1')。单击(函数()
{ 
$('.hidden_button').attr('type','button');
});
或此代码:

</section1>
    <input type="button" class='hidden_button' style='display:none'  value="Próximo" />
       <div class="row">
                    <header1>
  <input type="button" name="Next" id='button1' class="next action-button "  value="Próximo"/>
                    </header1>
<script type="text/javascript">                     
$('#button1').click(function()
{ 
 $('.hidden_button').show();
});</script>

but still with no success`
<input type='button' id='button1' />
<input type='button' class='hidden_button' style='display:none'/>
 <input type='button' class='hidden_button' style='display:none'/>

$('#button1').click(function()
{ 
 $('.hidden_button').show();

});

$('#按钮1')。单击(函数()
{ 
$('.hidden_button').show();
});

更好的方法是更改jquery,这样表单就不会被拆分,但如果这不是一个选项,您可以使用类似这样的方法

</section1>
    <input type="button" class='hidden_button' style='display:none'  value="Próximo" />
       <div class="row">
                    <header1>
  <input type="button" name="Next" id='button1' class="next action-button "  value="Próximo"/>
                    </header1>
<script type="text/javascript">                     
$('#button1').click(function()
{ 
 $('.hidden_button').show();
});</script>

but still with no success`
$(document).ready(function(){  
    $("#mainButton").click(function(){
        $( "#button2" ).click();
        $( "#button3" ).click();
    });
});

一次单击同时单击两个按钮:

</section1>
    <input type="button" class='hidden_button' style='display:none'  value="Próximo" />
       <div class="row">
                    <header1>
  <input type="button" name="Next" id='button1' class="next action-button "  value="Próximo"/>
                    </header1>
<script type="text/javascript">                     
$('#button1').click(function()
{ 
 $('.hidden_button').show();
});</script>

but still with no success`
Html:

</section1>
    <input type="button" class='hidden_button' style='display:none'  value="Próximo" />
       <div class="row">
                    <header1>
  <input type="button" name="Next" id='button1' class="next action-button "  value="Próximo"/>
                    </header1>
<script type="text/javascript">                     
$('#button1').click(function()
{ 
 $('.hidden_button').show();
});</script>

but still with no success`

Jquery:

</section1>
    <input type="button" class='hidden_button' style='display:none'  value="Próximo" />
       <div class="row">
                    <header1>
  <input type="button" name="Next" id='button1' class="next action-button "  value="Próximo"/>
                    </header1>
<script type="text/javascript">                     
$('#button1').click(function()
{ 
 $('.hidden_button').show();
});</script>

but still with no success`
<script type="text/javascript">$('#button1').click(function(){ $('#button2').click() });</script>
$('#button1')。单击(函数(){$('#button2')。单击();

感谢所有帮助我的人

嗯。。。你的剧本在哪里?你能把问题改写成句子吗?我不认为我能理解你的想法。我是jquery的noob:S@Flamur好的,这是通过等待一个id为“mainButton”的按钮被点击来实现的,当它运行该功能时,点击其中的两个按钮button2和button3都有这个功能,因为idi无法让jquery脚本以某种方式工作哈哈:S
</section1>
    <input type="button" class='hidden_button' style='display:none'  value="Próximo" />
       <div class="row">
                    <header1>
  <input type="button" name="Next" id='button1' class="next action-button "  value="Próximo"/>
                    </header1>
<script type="text/javascript">                     
$('#button1').click(function()
{ 
 $('.hidden_button').show();
});</script>

but still with no success`