以下のコードを参照してください jquery を学習していて、表示したい javascript/jqueryを使用して送信ボタンのクリック時に#childという名前のタグを付けて、ボタンのクリック時に呼び出す方法を教えてください
また、#子供と#家に電話したい >>(次のボタン) と <<(前のボタン)** のボタンクリックのタグをそれぞれコードで >> と << を < と &glt と書きます。誰でも私を助けることができますか?
<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>
17419 次
2 に答える
1
タグを表示するには
$('#child').show(); // where child is the id of the element
と隠すために..。
$('#child').hide();
または、次のように非表示と表示を切り替えることもできます。
$('#child').toggle();
これらをボタンのonclickイベントにアタッチするには..。
$(document).ready(function() {
$('#buttonID').click(function() {
$('#child').toggle();
});
});
お役に立てれば
于 2012-04-21T09:04:53.053 に答える
0
以下のコードはjavascript用です
var Home= document.getElementById("home");
Home.style.display="none";//To hide the div
Home.style.display="";//To display the div
于 2012-04-21T09:22:18.610 に答える