jquery Gets the current value value by Name,id name is the attribute value of the input tag, and jquery provides the attr () method for setting/Change attribute values$("Input:text"). attr ("name"));$("Input:text"). Prop ("name");//You can also get properties using the Prop () method$("*[name= ' name ']"). Val ();//Get Vlaue value$ ("*[name= ' name ']"). attr (' id ', ' name ');//Add ID name$ ("*[name= ' name ']"). After (' <div>hello world</div> ');//add an element outside the currentjquery uses the Name property to value the method alert ($ ("Input[name= ' inputtest ')"). Val ()); Alert ($ ("Input[type= ' text ']"). attr ("id"));//This is the value of the ID, easy to remember to write here$("Input[name= ' inputtest ')"). each (function() {alert ($ ( This). Val ());}) Alert ($ ("Input[name= ' inputtest ']") [0].value); alert ($ ("Input[name= ' inputtest ']") [1].value); alert ($ ("Input[name= ' inputtest ']"). Get (0). value);//You can also get a value here, equal to the two lines aboveAlert ($ ("Input[name= ' inputtest ']"). Get (1). Value); Value by name: $ ("Input[name= ' mobile ']"). Val () is based on the ID value: $ ("#mobile_reg_form"). HTML () takes the value of traversal by name: $ ("Input[name= ' mobile ']"). each (function() {alert ($ ( This). Val ()); }) remove input from the form:<script type= "Text/javascript" language= "JavaScript" charset= "UTF-8" >$ (document). Ready (function(){ vara=$ ("Form input"); $.each (A,function(name,object) {alert (name+":"+$ (object). val ()); } ); }); </script>Get the value (multiple cases): $ ("Input[name= ' mobile ']") [0].value $ ("Input[name= ' mobile ']"). Get (1). ValueAdd a Delete style-----jquery--------add a style to a label: $ ("#id"). AddClass ("style")); Delete a label's style: $ ("#id"). Removeclass ("style")); Note:The "#id" ID is the name of the corresponding CSS style that corresponds to the id,style of the label
jquery obtains the current value value by Name,id name