Jquery retrieves the text id and the value in the input for all the input attributes on the page, jqueryinput
Var inputid = ""; var inputArray = $ ("input [type = 'text']"); // retrieve all input text and put it in an array. inputArray. each (// use the array's cyclic function to loop this input Array function () {var input =$ (this); // each input element in the loop is inputid + = input. attr ("id") + ":" + $ ('#' + input. attr ("id ")). val () + ","; // view the id of each input in the loop })
In jquery, how does one obtain the content in text? How can I obtain the ID value in input, that is, 1?
$ ("#1"). val (); get the value of the specified id text
$ ("Input [type = 'text']"). attr ("id ");
In jquery, how does one obtain the input element object of the page [type = "text"] And the readonly attribute is true?
$ ('Input: text [readonly] ')