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

$ (Function () {var input = $ (': input', '# group1'); $ .eee (input, function (key, value) {$ (value) .parent (). Text (); // or $ (this)})})


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -