jquery implementation of the registration option to choose the reading terms move around _jquery

Source: Internet
Author: User

Choose reading terms when registering

<! DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 transitional//en" >
<title>demo2.html</title>
<meta http-equiv= "keywords" content= "keyword1,keyword2,keyword3" >
<meta http-equiv= "description" content= "This are my page" >
<meta http-equiv= "Content-type" content= "text/html; Charset=utf-8 ">
<!--<link rel= "stylesheet" type= "Text/css" href= "./styles.css" >-->
<script type= "Text/javascript" src= ". /js/jquery-1.9.1.js "></script>
<script type= "Text/javascript" >
$ (document). Ready (function () {
var $submitBtn =$ ("#submitBtn");//Get Button Object
Register Click events for buttons
$submitBtn. Click (function () {
Alert ("I was clicked!");
});
The first parameter of the second binding event is the type of the binding event, and the second parameter is the trigger function
$ (SUBMITBTN). bind ("click", Function () {
var $check =$ ("#agree");//Get Checkbook Element Object
Convert jquery to DOM objects
/*var checkdom= $check [0];
if (checkdom.checked) {
Alert ("Consent to register!");
}else{
Alert ("Please choose the terms of consent!");
}*/
if ($check. Is (": Checked")) {
Alert ("Consent to register!");
}else{
Alert ("Please choose the terms of consent!");
}
});
});
</script>

<body>
Registration terms: <input type= "checkbox" id= "Agree"/> I have read and accepted the CSDN registration terms.
<input type= "Submit" value= "registered" id= "submitbtn"/>
</body>


move around------------------------------------------------------------

<! DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 transitional//en" >
<title>demo03.html</title>
<meta http-equiv= "keywords" content= "keyword1,keyword2,keyword3" >
<meta http-equiv= "description" content= "This are my page" >
<meta http-equiv= "Content-type" content= "text/html; Charset=utf-8 ">
<!--<link rel= "stylesheet" type= "Text/css" href= "./styles.css" >-->
<script type= "Text/javascript" src= ". /js/jquery-1.9.1.js "></script>
<script type= "Text/javascript" >
$ (document). Ready (function () {
var $romve =$ ("#romve");
var $romves =$ ("#romves");
$romve. Click (function () {
var $opts =$ ("#ropt >option:selected");
$opts. Appendto ("#lopt");
});
$romves. Bind ("click", Function () {
var $opts =$ ("#ropt >option");
Alert ($opts. length);
$opts. Appendto ("#lopt");
});
Double click
$ ("#ropt"). Bind ("DblClick", function () {
var $pots =$ ("#ropt >option:checked");
$pots. Appendto ("#lopt");
});
});
$ (document). Ready (function () {
var $lromve =$ ("#lromve");
var $lromves =$ ("#lromves");
Registering the Click event
$lromve. Click (function () {
var $opts =$ ("#lopt >option:selected");
$opts. Appendto ("#ropt");
});
Binding events
$lromves. Bind ("click", Function () {
var $opts =$ ("#lopt >option");//Get all option
Alert ($opts. length);
$opts. Appendto ("#ropt");
$ ("#ropt"). Append ($opts);
});
Double click
$ ("#lopt"). Bind ("DblClick", function () {
var $opts =$ ("#lopt >option:checked");//Get all option
$opts. Appendto ("#ropt");
});
});
</script>
<body>
&LT;H1 align= "Center" > left-Right Drift <div style= "Position:absolute; left:450px; top:120px ">
<div style= "Float:left; width:200px; height:300px; Background-color:lightsteelblue; Text-align:center; " ><br><br>
<select id= "lopt" multiple= "multiple" size= "9" style= "width:80px"; >
<option>aa</option>
<option>bb</option>
<option>cc</option>
<option>dd</option>
<option>ee</option>
<option>ff</option>
<option>gg</option>
<option>hh</option>
<option>pp</option>
</select>
<br/><br/>
<input type= "button" id= "Lromve" value= "Selected right Shift" style= "width:80px;" /><br/><br/>
<input type= "button" id= "Lromves" value= "All Right Move" style= "width:80px;" />
</div>
<div style = "width:200px; height:300px; Background-color: #bbffaa; Text-align:center; " ><br><br>
<select id= "ropt" multiple= "multiple" size= "9" style= "width:80px"; >
<option> Options 1</option>
<option> Options 2</option>
<option> Options 3</option>
<option> Options 4</option>
<option> Options 5</option>
<option> Options 6</option>
<option> Options 7</option>
<option> Options 8</option>
<option> Options 9</option>
</select>
<br/><br/>
<input type= "button" id= "Romve" Value= "selected left-shifted" style= "width:80px;" /><br/><br/>
<input type= "button" id= "Romves" value= "all moved left" style= "width:80px;" />
</div>
</div>
</body>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.