Common jquery Examples

Source: Internet
Author: User

1. Radio button

<!DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 transitional//en"><HTML><Head>    <title>Js24.html</title>    <Metahttp-equiv= "Content-type"content= "text/html; charset=utf-8">    <Scripttype= "Text/javascript"src= "Jquery/jquery-3.2.1.min.js"></Script>   <Scripttype= "Text/javascript"src= "Test.js"></Script></Head><Body><Div>    <inputtype= "Radio"name= "Sex"value= "M"checked>Man<BR>    <inputtype= "Radio"name= "Sex"value= "F">Woman<BR></Div><inputtype= "button"value= "click me"onclick= "invoice.test ();"></Body></HTML>

Test.js

;(function(window, document, undefined) {var Invoice =function  () {     // defines a property that an object receives a page passed over    var New Object ();     // the value taken is either male or female, but M or F, which I understand is the value    of the property of value Params.sex = $ ("Input[name= ' Sex ']:checked"). Val ();    Alert ("Gender:" += Invoice;}) (window, document);

2. Drop-down list

<!DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 transitional//en"><HTML><Head>    <title>Js24.html</title>    <Metahttp-equiv= "Content-type"content= "text/html; charset=utf-8">    <Scripttype= "Text/javascript"src= "Jquery/jquery-3.2.1.min.js"></Script>    <Scripttype= "Text/javascript"src= "Test.js"></Script></Head><Body><Div>    <SelectID= "Cartype">        <optionvalue= "Volvo">Volvo</option>        <optionvalue= "Saab">Saab</option>        <optionvalue= "Opel">Opel</option>        <optionvalue= "Audi">Audi</option>    </Select></Div><inputtype= "button"value= "click me"onclick= "invoice.test ();"></Body></HTML>

Test.js

;(function(window, document, undefined) {var Invoice =function  () {     var New Object ();     = $ ("#carType"). Val ();    Alert ("model:" += Invoice;}) (window, document);

Common jquery Examples

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.