Summary of the jquery trivia points used by Intel projects

Source: Internet
Author: User
Tags tagname

1.$ ("#tdGeo input[type= ' checkbox ']:checked")---filter out all checkboxes that have been check

2.$ ("#tdCountry input[type= ' checkbox ']"). attr (' disabled ', ' disabled '). Removeattr ("checked"); ---Adding the disabled property and deleting the Checked property

3.$ ("#stateOptions"). HTML ("<option value= ' all ' >ALL</option>"); Dynamically Loading HTML---front-end

4.$ (This). Val (); ---Gets the value of the current element

5.$ ("#state"). Val (""); ---text box to empty

6.statetext.val (). replace (Obj.value +, "," ")---remove commas in text boxes with the Replace method

7.$ ("#stateOptions input[type= ' checkbox ']:gt (0)")---get all checkboxes, excluding the first one

8.var statestring = $ ("#state"). Val ();

var Statearr = new Array ();

Statearr = Statestring.split (",");

for (i = 0; i < statearr.length-1; i++) {

var state1 = statearr[i]; ---Gets the value in state, converts it to an array and loops the value in the format "1,2,3,4,5"

9.$ (This). Prop ("Checked", "true"); ---Add selected attributes to a checkbox

10.$ (' Html,body '). Click (function (e) {

if (e.target.id! = "Divstate" && e.target.id! = "State" && e.target.id! = "Stateoptions" && E.targ Et.id! = "Stateoption") {

$ ("#stateOptions"). Hide ();

} }); ---Add the click event to the entire HTML body by judging if the click is blank and hiding the relevant Div

--event.target.id gets the current target element ID

--event.target.tagname gets the current target element tagname such as: Span,div,input ...

--event.target.nodename gets the current target element nodename and tagname similar, general return such as: Span,div,input ...

Summary of the jquery trivia points used by Intel projects

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.