<! Doctype HTML public "-// W3C // dtd xhtml 1.0 transitional // en" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<HTML xmlns = "http://www.w3.org/1999/xhtml">
<Head>
<Meta http-equiv = "Content-Type" content = "text/html; charset = UTF-8"/>
<Title> untitled document </title>
<SCRIPT src = "jquery-starterkit/lib/jquery-1.3.2.min.js" type = "text/JavaScript"> </SCRIPT>
</Head>
<Body>
<Input type = "text" id = "DD" name = "DD" value = "DDS"/> dd
<Input name = "RR" id = "RR" type = "radio" value = "34"/> FF
<Input name = "RR" id = "rr2" type = "radio" value = "4"/> 55
<Input name = "FF" type = "checkbox" value = "AA"/> jgdg
<Input name = "FF" type = "checkbox" value = "GD"/> jgdg
<Select name = "SS" id = "SS" size = "1">
<Option value = ""> </option>
<Option value = "8"> d </option>
<Option value = "2"> G </option>
</SELECT>
<Br/>
<Input type = "button" id = "button" value = "button 1"/>
<Input type = "button" id = "JJ" value = "button 2"/>
<Br/>
<Div id = "SSD"> fgoohello </div>
</Body>
<Script language = "JavaScript" type = "text/JavaScript">
<! --
$ (Function (){
$ ("# Button"). Click (function (){
// Obtain the value $ ("# Dd"). ATTR ("value ");
// Alert ($ ('# dd'). Val (); // type = text
// Alert ($ ('input [name = RR] [checked] '). Val (); // type = radio
// Alert ($ ('input [name = ff] [checked] '). Val (); // type = checkbox
// Alert ($ ("select [name = SS] Option [selected]"). val (); // select is equal to alert ($ ("# SS option [selected]"). val ());
// Obtain text
// Alert ($ ("select [name = SS] Option [selected]"). Text (); // select
// Control
/* // Disable # disable dd
$ ("# Dd"). ATTR ("disabled", "disabled ");
// Enable # dd unban
$ ("# Jj"). removeattr ("disabled ");*/
// $ ('Input [name = RR] '). Get (0). Checked = true; // The first radio is selected
// Alert ($ ("input [type = radio] [value = 34]"). ATTR ("checked", 'checked'); // radio with value = 34 is selected
// Alert ($ ("input [type = checkbox] [value = Gd]"). ATTR ("checked", 'checked'); // value = Gd checkbox is selected
// $ ('Input [name = ff] '). Get (1). Checked = true; // The first check is selected
/* // Select option based on option text
Count = $ ("# SS"). Find ("option"). length;
For (VAR I = 0; I <count; I ++)
{
If ($ ("# SS"). Get (0). Options [I]. Text = 'D ')
{
$ ("# SS"). Get (0). Options [I]. Selected = true;
Break;
}
}*/
// $ ("<Option value = '1'> 1111 </option> <option value = '25'> 22s22 </option> "). appendto ("# SS"); // Add Option
// $ ("# SS option [value = 8]"). Remove (""); // remove <option value = '8'> d </option>
// $ ("# SS"). ATTR ("value", '2'); // select option
// $ ('# Ss') [0]. selectedindex = 1; // select option
// $ ("# SS"). Empty (); // clear all options
/* // Replace text
VaR $ thirdlink = $ ("# SSD ");
VaR linktext = $ thirdlink. Text (). Replace ('foo', 'bar ');
$ Thirdlink. Text (linktext );*/
});
-->
================== ========================================================== ===