问题描述
-
请参考下面的代码学习jquery,我想在提交按钮上显示名为 #child 的
标记点击使用javascript / jquery可以任何一个帮助我如何调用按钮点击 > 标记于>>(下一个按钮)& <<(prev button)** on button分别在代码>>和<<写成& lt和& glt。?任何人
都可以帮助我?
< div data-role =pageid =home> ;
< div data-theme =ddata-role =header>
< h3>
Grand Bhagvati
< / h3>
& lt;& lt;
< / a>
& gt;& gt;
< / a>
< / div>
< div data-role =content>
< div data-role =fieldcontain>
< fieldset data-role =controlgroupdata-mini =true>
< label for =textinput1>
用户:
< / label>
< input id =textinput1placeholder =Khushutype =text/>
< / fieldset>
< / div>
< input data-theme =d=submitbtnvalue =Logintype =submitonSubmit =redirect()/>
< / div>
< div data-theme =adata-role =footerdata-position =fixed>
< h3>
Page1
< / h3>
< / div>
< / div>
< div data -role =pageid =child>
< div data-theme =ddata-role =header>
< h3>
Grand Bhagvati
< / h3>
& lt;& lt;
< / a>
& gt;& gt;
< / a>
< / div>
< div data-role =content>
< div data-role =fieldcontain>
< fieldset data-role =controlgroupdata-mini =true>
< label for =textinput1>
用户:
< / label>
< input id =textinput1placeholder =Khushutype =text/>
< / fieldset>
< / div>
< input data-theme =dvalue =Logintype =submitonsubmit =redirect()/>
< / div>
< div data-theme =adata-role =footerdata-position =fixed>
< h3>
Page1
< / h3>
< / div>
< / div>
$('#child ')。显示(); //其中child是元素的id
并隐藏...
$('#child')。hide();
或者,您可以简单地在hide / show之间切换它,如下所示:
$('#child')。toggle();
将这些添加到按钮的onclick事件中...
$(document).ready(function(){
$('#buttonID')。click(function(){
$ ('#child')。toggle();
});
});
希望这可以帮助您
Please refer code below i m learning jquery and i want to display tag named #child on submit button click using javascript/jquery can any one help me how to call on button click
And also want to call #child and #home tag on >>(next button) & <<(prev button)** on button click respectively in code >> and<< is written as < and &glt.? can anyonehelp me out ?
<div data-role="page" id="home"> <div data-theme="d" data-role="header"> <h3> The Grand Bhagvati </h3> <a data-role="button" data-inline="true" data-direction="reverse" data-transition="slide" href="#home"> << </a> <a data-role="button" data-inline="true" data-direction="reverse" data-transition="fade" href="#child"> >> </a> </div> <div data-role="content"> <div data-role="fieldcontain"> <fieldset data-role="controlgroup" data-mini="true"> <label for="textinput1"> User: </label> <input id="textinput1" placeholder="Khushu" type="text" /> </fieldset> </div> <input data-theme="d" ="submitbtn" value="Login" type="submit" onSubmit="redirect()"/> </div> <div data-theme="a" data-role="footer" data-position="fixed" > <h3> Page1 </h3> </div> </div>
<div data-role="page" id="child"> <div data-theme="d" data-role="header"> <h3> The Grand Bhagvati </h3> <a data-role="button" data-inline="true" data-direction="reverse" data-transition="slide" > << </a> <a data-role="button" data-inline="true" data-direction="reverse" data-transition="fade" > >> </a> </div> <div data-role="content"> <div data-role="fieldcontain"> <fieldset data-role="controlgroup" data-mini="true"> <label for="textinput1"> User: </label> <input id="textinput1" placeholder="Khushu" type="text" /> </fieldset> </div> <input data-theme="d" value="Login" type="submit" onsubmit="redirect()"/> </div> <div data-theme="a" data-role="footer" data-position="fixed" > <h3> Page1 </h3> </div> </div>
To show a tag use
$('#child').show(); // where child is the id of the element
and to hide ...
$('#child').hide();
alternatively, you can simply toggle it between hide/show as follows:
$('#child').toggle();
to attach these to an onclick event of a button ...
$(document).ready(function() {
$('#buttonID').click(function() {
$('#child').toggle();
});
});
hope this helps
这篇关于如何拨打< div>点击提交按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!