3.23 Notes

data.no = user input value

  1. jQuery provides two methods to convert a jQuery object into a DOM object, namely [index]and get(index).
//第一种方法

lg($('#dd'));
lg($('#dd')[0]);

//第二种方法
lg($('#dd'));
lg($('#dd').get(0));

Just wrap the DOM object to get a jQuery object.

	var dd = document.getElementById('dd');
	var $dd = $(dd);
	lg($dd);

Selector describe
#id Match an element based on a given ID
.class Match elements based on the given class name
element Match elements by given element name
* match all elements
selector1,selector2,selector3 Combine the elements matched by each selector and return

var person = Create object number must not be repeated!

peron 

The empty constructor is used to instantiate the object (you can also initialize the value, and assign the initial value to the variable in the constructor). For example, new Person() of Person p=new Person();. The latter Person() is actually the Person() constructor.

If someone has already created a person, you can use it directly

was person;

if(localStorage.getItem('person')){

person = JSON.person(localStorage.getItem('person'));

}

JSON : JavaScript Object Notation  JSON  is a syntax for storing and exchanging textual information





Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325641526&siteId=291194637