我需要创建一个隐藏很少文本字段的 html 页面,单击下一步按钮时需要使用 javascript 和 jquery 显示



>我需要创建一个隐藏很少的文本字段的html页面,并且在单击下一步按钮时需要显示它们。 我们可以使用 JavaScript 和 jQuery 来做到这一点吗?

<label for="Name">Enter a site name:</label>
<input type="text" id="Name"></input>
<label for="Scope">scope:</label>
<input type="text" id="Scope"></input>
<input type="next" id="next" value="next" </input> 
<label for="No">no:</label>
<input type="text" id="No"></input>
<label for="No">order no:</label>
<input type="text" id="order No"></input>   
<input type="submit" id="submit" value="Submit" data-theme="b"></input> 

html 页面应在单击"下一步"时显示前两个字段,应显示"下一步"按钮下方的字段。 可以使用Java脚本来完成吗?请帮我编码。如何编码?

尝试这样的事情:

<label for="Name">Enter a site name:</label>
<input type="text" id="Name">
<label for="Scope">scope:</label>
<input type="text" id="Scope">
<input type="next" id="next" value="next" >
<div id="showdiv" style="display:none;">
<label for="No">no:</label>
<input type="text" id="No"></input>
<label for="No">order no:</label>
<input type="text" id="order No"></input>   
<input type="submit" id="submit" value="Submit" data-theme="b"></input> 
</div>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js">
</script>
<script>
$(document).ready(function(){
  $("#next").click(function(){
    $('#showdiv').show();
  });
});
</script>

最新更新