Front page syntax for jquery javascript ajax

Source: Internet
Author: User

<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">Select the TD label containing the A label $ ("Td:has (A)"). CSS ("Background", "pink"); When the Submit button is clicked, the function that fires is $ (": Submit"). Click (function () {//SELECT ID ID has special character escaping//$ ("#id # #")-->$ ("#id \ #2")//$ ("#id \ #2"). HTML ( "This is #id#2 text content");//The property selector does not have to escape//$ ("[id= ' id#2 ']"). HTML ("This is the text content of #id#2"),//$ ("#id [2]")-->$ ("#id \\[2\\]")//Award The Value property of the label for the text of the broken property is 0 words//if ($ (": Text"). Val (). length==0) {//alert (' username is empty ')/};
The Value property of the last label in the label that determines the property is password is 0 words//if ($ (":p assword:last"). Val (). length==0) {//alert (' Confirm password is null ')/}
Only the attributes for the Text,password label are required. Val () to get the text can accommodate the others do not need to join. Val ()
The value of the label in the label that determines the property to radio is checked the selected state of the tag is not 0, if ($ (": radio:checked"). length!=0) {alert ($ (": radio:checked"). Val ())};if ($ (": checkbox:checked"). length!=0) {alert ($ (": checkbox:checked"). Val ())};
Determine if the Value property of the column in the dropdown box is selected is not equal to "" if ($ (": Selected"). val ()! = "") {Alert ($ (": Selected"). val ())});});

JavaScript syntax when a form is loaded//window.onload=function () {
Get the value of the background background color for the tag with the element ID username tag plus the style in the label and the alert pop-up window//var Box1=document.getelementbyid ("username");//var Box2= "Username:" +box1.style.background;//alert (Box2);
          By defining the tag variable you can directly modify the value of the property in the label the following is the syntax for modifying the background color and the Value property in a Style style property simple rude//box1.style.background= "blue";//box1.value= "456"; }</script><style type= "Text/css" >.c{color:red;} </style>

Front page syntax for jquery javascript ajax

Related Article

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.