Get the values of Dynamically created elements using Jquery I am dynamically creating input elements using jquery, but when I try to access the dynamically created element values, I'm getting either empty or undefined or . I tried many ways to get the values, but It is failing.  Could someone help me getting this done.  Here is the code     $(document).ready(function() {   var count = 0;   var jsondata = [];   var selectedField;   $('.add').click(function() {     count = count + 1;     jQuery('&lt;div/&gt;', {       id: 'form-wrapper' + count,       class: 'form-wrapper' + count,       title: 'now this div has a title!'     }).appendTo('.wrapper0');     $('.form-wrapper' + count).append("&lt;label&gt;FieldName&lt;/label&gt; &lt;input type='text' placeholder='label' id='label" + count + "'&gt;&lt;/input&gt; &lt;select class='select" + count + "'&gt;&lt;option&gt;Select&lt;/option&gt;&lt;option value='textbox'&gt;Textbox&lt;/option&gt;&lt;option value='textarea'&gt;TextArea&lt;/option&gt;&lt;option value='checkbox'&gt;Checkbox&lt;/option&gt;&lt;option value='radio'&gt;Radio&lt;/option&gt;&lt;option value='date'&gt;Date&lt;/option&gt; &lt;/select&gt;&lt;input type='text' id='commavalues" + count + "' disabled placeholder='Enter comma(,) seperated values'&gt;&lt;/input&gt;&lt;input type='checkbox' id='required" + count + "'&gt;Required&lt;/input&gt;&lt;button class='delete'&gt;Delete&lt;/button&gt; &lt;br&gt;&lt;br&gt;");      $('.delete').click(function(e) {       ($(this).parent().remove());     });      $('.select' + count).change(function() {       selectedField = $(this).children('option:selected').val();       if (selectedField == 'checkbox' || selectedField == 'radio') {         $('#commavalues' + count).prop('disabled', false);         flag = 1;       } else {         flag = 0;         $('#commavalues' + count).prop('disabled', true);       }     });     item = {};      var label = $('#label' + count).val();     var required = $('#required' + count).is(":checked");     var label_type = selectedField;     var options = $('#commavalues' + count).val();      console.log(label);     console.log(required);     console.log(label_type);     console.log(options);      item["label"] = label;     item["label_type"] = label_type;     item["options"] = options;     item["required"] = required;     jsondata.push(item);   });    $('.save').click(function() {     console.log(jsondata);   }); }); body {   background-color: #ECEFF1;   margin: 50px 0;   padding: 0;   text-align: center; }  button {   position: relative;   margin-left: 0px; } &lt;script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"&gt;&lt;/script&gt; &lt;div class="wrapper0"&gt;   &lt;div class="form-wrapper"&gt;     &lt;label&gt;FieldName&lt;/label&gt;     &lt;input type="text" placeholder="label" class="label0"&gt;&lt;/input&gt;     &lt;select class="select0"&gt;       &lt;option&gt;Select&lt;/option&gt;       &lt;option value="textbox"&gt;Textbox&lt;/option&gt;       &lt;option value="textarea"&gt;TextArea&lt;/option&gt;       &lt;option value="checkbox"&gt;Checkbox&lt;/option&gt;       &lt;option value="radio"&gt;Radio&lt;/option&gt;       &lt;option value="date"&gt;Date&lt;/option&gt;     &lt;/select&gt;     &lt;input type="text" class="commavalues0" disabled placeholder="Enter comma(,) seperated values"&gt;&lt;/input&gt;     &lt;input type="checkbox" class="required0"&gt;Required&lt;/input&gt;     &lt;br&gt;&lt;br&gt;   &lt;/div&gt; &lt;/div&gt; &lt;button class="add"&gt;Add&lt;/button&gt; &lt;button class="save"&gt;Save&lt;/button&gt;     I am trying to display in JSON format when I click save button, and If i click the delete button the data associated to that input fields are to be deleted also.
Event binding on dynamically created elements? I have a bit of code where I am looping through all the select boxes on a page and binding a .hover event to them to do a bit of twiddling with their width on mouse on/off.  This happens on page ready and works just fine.  The problem I have is that any select boxes I add via Ajax or DOM after the initial loop won't have the event bound.  I have found this plugin (), but before I add another 5k to my pages with a plugin, I want to see if anyone knows a way to do this, either with jQuery directly or by another option.
Evaluating $\int_0^{\tfrac{\pi}{4}}\ln(\cos x-\sin x)\ln(\cos x) dx - \int_0^{\tfrac{\pi}{4}}\ln(\cos x+\sin x)\ln(\sin x)dx=\frac{G\ln 2}{2}$ In order to compute, in an elementary way,  $\displaystyle \int_0^1 \frac{x \arctan x \log \left( 1-x^2\right)}{1+x^2}dx$  (see  )  i need to show, in a simple way, that:  $\displaystyle \int_0^{\tfrac{\pi}{4}}\ln(\cos x-\sin x)\ln(\cos x) dx - \int_0^{\tfrac{\pi}{4}}\ln(\cos x+\sin x)\ln(\sin x)dx=\dfrac{G\ln 2}{2}$  $G$ being the Catalan constant.  The reason of my interest for this question is, if i am right, that this formula permits to find out a relation between integrals:  $\displaystyle \int_0^1 \dfrac{\ln(1+x)\ln(1+x^2)}{1+x^2}dx$  $\displaystyle \int_0^1 \dfrac{\ln(1+x)^2}{1+x^2}dx$  $\displaystyle \int_0^{\tfrac{\pi}{4}}\big(\ln(\cos x)\big)^2 \dfrac{}{}dx$  and some constants. Terminal not displaying colors for directory listings I don't know why my bash session doesn't show colors. I have tried Terminal as well as iTerm.  I have tried:   ls -G Setting export CLICOLOR=1 and export LSCOLORS=GxFxCxDxBxegedabagaced Using different themes such as solarized and something else   The versions of my software are:   bash: GNU bash, version 3.2.51(1)-release (x86_64-apple-darwin13) osx: 10.9.2   I have Homebrew installed  I don't know what other information might be helpful. I spend a lot of time on the shell, this problem is becoming very annoying :)  edit: in terminal preferences, I have 'Declare terminal as: xterm-256color' and 'Display ANSI colors' along with 'Use bright colors for bold text' Solving $4x = e^x$ without graphing and looking for intersection How do I create files using the lines in a .txt file? For example I have a file called fileNames.txt.  cat &gt;fileNames returns  abet  able  abacus   How do I use fileNames to create abet, able, and abacus as .txt files?  I tried using pipes with cat and touch. Throughout Blade Runner we see Gaff (Edward James Olmos) making origami figures at various points in the movie. He makes a chicken, matchstick men and at the end of the film there is a unicorn waiting outside Deckard's apartment.    There is a   of  out there regarding the unicorn in particular, and how it indicates that Deckard is a replicant. I think an answer regarding the use of origami in general will be interesting new ground to cover.  Why origami? What does the origami represent in Blade Runner? How do we control web page caching, across all browsers? Is it ethical to withdraw a paper after acceptance in order to resubmit to a better journal? Find Nearby Accounts migration to Google Maps API v3 Prove the divergence of the sequence $\left\{ \sin(n) \right\}_{n=1}^{\infty}$. I am looking for nice ways of proving the divergence of the sequence $\left\{x_n\right\}_{n=1}^{\infty}$ defined by $$x_n=\sin{(n)}.$$ One (not so nice) way is to construct two subsequences: one where the indexes are picked such that they lie in the intervals  $$I_k=\left(\dfrac{\pi}{6}+2\pi(k-1),\dfrac{5\pi}{6}+2\pi(k-1)\right)$$ and one where they lie in $$J_k=\left(\dfrac{7\pi}{6}+2\pi(k-1),\dfrac{11\pi}{6}+2\pi(k-1)\right).$$ If ${x_n}$ converges, then all its subsequences must converge to the same limit, but here the first subsequence has all its values in the interval $\left[ \frac{1}{2}, 1\right]$ while the second has its values in $\left[-1,-\frac{1}{2}\right]$. Contradiction.  Filling the details of this proof is rather tedious and not very elegant. Anyone has a better idea? I need rules to drop some malicious Apache connections Has anyone had success recovering deleted files from an ext4 partition? I've tried various utilities, but none have worked yet. I'd be grateful if someone can share a success story! Are any of the alien languages in Star Wars real Earth languages? Are any of the alien languages (other than English and binary) in Star Wars movies or TV shows real Earth languages? Combination proof for $n(n+1)2^{n-2}=\sum_{k=1}^{n}k^2\binom{n}{k}$ How can I show that   let $n$ and $k$ be integers.  $n(n+1)2^{n-2}=\sum_{k=1}^{n}k^2\dbinom{n}{k}$  It seems a bit confusing to me on the left hand side. You have a set of $n$ people on a team and you keep picking $k$ people who will play a match and you pick before that a captain $k^2$. Scale settings for exporting to STL (for 3d printing) Command Options on Command Line - Details and Functions? What are some grandiloquent, or simply better, ways of expressing "an idea/thought suddenly came to me", or "an idea/thought struck me", or "I was struck by an idea/thought"? If $\psi h$ is in $L^2$ for all $h\in L^2$, must $\psi$ be essentially bounded? If $\psi:[a,b]\to\mathbb C$ is a (measurable) function such that $\psi h$ is in $L^2[a,b]$ for all $h\in L^2[a,b]$, then must $\psi$ be essentially bounded?  The converse direction is clear: If $\psi$ is essentially bounded, then $\|\psi h\|_2\leq \|\psi\|_\infty\|h\|_2$ for all $h\in L^2$, and thus the multiplication operator $M_\psi:h\mapsto \psi h$ is defined and bounded.  The question here is whether, without prior assumptions on $\psi$, simply having $M_\psi(L^2)\subseteq L^2$ implies that $\psi$ is bounded. sum of the residue at all poles of the rational function p/q is 0. We are given two polynomials p, q with deg(q)>1+deg(p). Show that the sum of the residue at all poles of the rational function p/q is 0.   How do I go about solving this? Early 90s mecha anime where the mecha was like Voltron in that each pilot controlled a portion of the mecha that would merge into a bigger mecha I'm trying to find an anime movie I watched when I was younger; I believe I first watched it in 90/91. The story revolved around the recruitment and training of a group that would pilot a mecha that was similar to Voltron in that each pilot controlled a portion of the mecha that would merge into a bigger mecha. Points that I remember:   Started on Earth Program was government funded One of the pilots was related to the creator of the program, I think a female Mecha had chain weapon and a sword that was summoned from it's superhero-like chest icon. Killing blow was an m or w shape Ended with father/creator of mecha? being kidnapped by the aliens and used as human shield to deter attack on alien vessel Blender 2.8 - How to access material nodes?