jquery - Get parent text of input element -
I want to capture all the inputs and get their labels, so, in this particular case, the customer ID, the name of the customer and I want to get a birthday.
& lt; Div id = "group1" & gt; & Lt; Div class = "col-4 last-col" & gt; Customer ID: & lt; Br / & gt; & Lt; Input name = "tbCustomerId" id = "tbCustomerId" type = "text" /> & Lt; / Div & gt; & Lt; Div class = "col-4 last-col" & gt; Customer's Name: & lt; Br / & gt; & Lt; Input name = "tbCustomerName" id = "tbCustomerName" type = "text" / & gt; & Lt; / Div & gt; & Lt; Div class = "col-4 last-col" & gt; Birthday: & lt; Br / & gt; & Lt; Input name = "tbCustomerBirthdayDate" id = "tbCustomerBirthdayDate" type = "text" /> & Lt; / Div & gt; & Lt; / Div & gt; I have so far:
& lt; Script type = "text / javascript" & gt; $ (Function () {var inputs = $ (': input', '# group1'); $ .EEEE (input, function (key, value) {// I've tried value.parent (). Text () But not luck.})}) & Lt; / Script & gt;
change value to jQuery object
Comments
Post a Comment