JQuery converts the acquired input value into JSON

Don’t say, please see the code:

 jQuery converts the obtained INPUT value to JSON   .box {width: 500px; Height: 500px; border: 1px solid # E5E5E5;}     Name:    Birthday:      
省份:



$ (Document) .ready (". Comment"). Click (function () {paraarr = {}; var username = $ ('INPUT [name = username]'). Val (). Replace (/ (^ \ s *) | (\ s * $) / g, ""); paarr.username = Username VAR AGE = $ ('INPUT [Name = age]'). Val (). Replace (/ (^ \ S *) | (\ S * $) / g, ""); paarr.age = age; var Birth = $ ('INPUT [Name = Birth]'). Val (). Replace (/ (^ \ S *) | (\ S * $) / g, ""); paarr.birth = birthVAR City = $ ('INPUT [Name = City]'). Val (). Replace (/ (^ \ s *) | (\ s * $) / g, ""); paarr.city = city; var Provicen = $ ('INPUT [Name = provicen]'). Val (). Replace (/ (^ \ s *) | (\ S * $) / g, ""); paarr.provicen = provicen; var sex = $ ('INPUT [Name = SEX]'). Val (). Replace (/ (^ \ s *) | (\ s * $) / g, ""); paarr.sex = sex; var params = json. Stringify (PARARR); Alert (params);});});


The above is all the contents of this article, it is desirable The content can help everyone's learning or work, and I hope to support TUMI cloud!
© Copyright Notice
THE END
Just support it if you like
like0
share
comment Grab the couch

Please log in to comment