I'd like to swap the contents of 2 DIV's on "click".   DIV-1 should get the content of DIV-2.  DIV-2 should get the content of DIV-1.   I can get that to work but the DIV-content originally contained jQuery-elements and of course the "on-clicks" in the swapped-content do not work anymore.   How can I get the jquery-elements working after swapping content??  I use a hidden DIV (class="temp_backup") as a "container" for the swapping of the content......  I use following jQuery-code to swap content:    $('span.ShowNumber').click(function() {    var getID = $(this).attr('id');   var spanNumber = getID.replace("ShowNumber", "");    $('div.temp_backup').html($("div[id=table-cell-1]").html());   $("div[id=table-cell-" + spanNumber + "]").html($("div[id=table-cell-2]").html());   $("div[id=table-cell-2]").html($('div.temp_backup').html());  }); &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt; &lt;span class="ShowNumber" id="ShowNumber1"&gt;1&lt;/span&gt; &lt;div id="table-cell-1"&gt;Content of DIV-1 with jquery elements/functions&lt;/div&gt;  &lt;span class="ShowNumber" id="ShowNumber2"&gt;2&lt;/span&gt; &lt;div id="table-cell-2"&gt;Content of DIV-2 with jquery elements/functions&lt;/div&gt;  &lt;div class="class=" temp_backup " style="display:none "&gt;&lt;/div&gt;
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.
How to use triangle inequality to establish Reverse triangle inequality I need to use $|a+b| \leq |a|+|b|$ to show that $||a|-|b|| \leq |a-b|$ .   I have tried to represent  $||a|-|b||$ as  $||a|+(-|b|)|$ , and then get $||a|+(-|b|)| \leq |a|+|-|b||$ , but that isn't leading me anywhere given $|a-b| \leq |a|+|b|$. I've been trying to prove that given a ring $R$ and a collection of ideals $\{I_{\beta}\}_{\beta \in B}$ in $R$, the set $$\sum_{\beta \in B} I_{\beta}=\{f_1+\cdots+f_r:f_j \in I_{\beta_j}, \mbox{ for some } I_{\beta_j}\}$$ is an ideal and is the smallest ideal containing $\cup_{\beta \in B} I_{\beta}$.  I've already proved when I only have two ideals, and so, using induction, I've seen it for finite sums. But I don't see how to generalise that to an arbitrary family of indexes (maybe infinite) $\beta$.   Could someone please give me a hand? Thank you. How does the Comma Operator work What if MSE used a different rep model for privileges? Do I need quote marks when I quote myself? I'm completely new and lost in Ubuntu 12.04, I'm having trouble navigating to my Sublime folder which I know is in my /opt folder. Yet I've tried to no avail to navigate into it via Terminal window. The directory is colored in blue, no idea what this means...but I am able to access the folder using the GUI explorer...?  k@k-Ubuntu:~$ cd /opt k@k-Ubuntu:/opt$ ls Sublime Text 2 k@k-Ubuntu:/opt$ cd Sublime Text 2 bash: cd: Sublime: No such file or directory k@k-Ubuntu:/opt$ cd /Sublime Text 2 bash: cd: /Sublime: No such file or directory If I use the starting wealth rolls of my class, do I keep any remaining money left over? If I use the starting wealth rolls of my class, do I keep any remaining money left over after I buy equipment?  In D&amp;D 5e you can roll the 4d4 &times; 10 to determine starting gold, forgoing any equipment your class and background  gets.  This is not up for question.  What is up for question is whether or not the PC keeps any remaining gold that they don't spend on equipment.   As far as I have been able to tell, this is not explicitly stated in the PHB nor in the Basic Rules documents. rake db:migrate doesn't seem to work in production Find the MLE of the unknown parameter $\theta$ when $X_1,X_2,...,X_n$ is a sample from the distribution whose density function is: $$f_X(x) = \frac12e^{-|x-\theta|}, -\infty&lt;x&lt;\infty$$ What I did so far: $$\text{maximize }(\frac12)^ne^{-|x_1-\theta|-|x_2-\theta|-...-|x_n-\theta|} \\ \text{thus we want to minimize }|x_1-\theta|+|x_2-\theta|+...+|x_n-\theta|$$ Since $|x_i-\theta|$ is positive for all $i$, we want to solve for $\theta$ so: $$|x_1-\theta|+|x_2-\theta|+...+|x_n-\theta|=0$$ What do I do from here? Detecting pattern at the end of a line with grep I am struggling to understand zero inflated distributions. What are they? What's the point?  If I have data with many zeroes, then I could fit a logistic regression first calculate the probability of zeroes, and then I could remove all the zeroes, and then fit a regular regression using my choice of distribution (poisson e.g.).  Then somebody told me "hey, use a zero inflated distribution", but looking it up, it does not seem to do anything differently than what I suggested above? It has a regular parameter $\mu$, and then another parameter $p$ to model the probability of zero? It just does both things at the same time no? Prove that $\gcd(a^n - 1, a^m - 1) = a^{\gcd(n, m)} - 1$ For all $a, m, n \in \mathbb{Z}^+$,   $$\gcd(a^n - 1, a^m - 1) = a^{\gcd(n, m)} - 1$$ I was wondering how light or any electromagnetic radiation can be "absorbed" if it consists of electric and magnetic fields. For example if there is a charge at point A, and the  light reaches point A, it will cause that charge to move depending on the value of the electric field. However, why wouldn't this electric field continue on and influence others particles everywhere else? For example, if you have a static charge creating an electric field, then if you put a charge at point A it will feel its effects and then if you bring a charge at another location B it will also feel its effects, namely it will not have been absorbed. Please shed some light on this. Thanks  edit: Does this mean the electron that absorbs this light moves in such a way that it creates an electric field of its own canceling the initial one? Or am I way off? How to set English as default language instead of Tamil? The default language used in our laptop is Tamil. We don't know how to switch back to English. If we type something we are getting something.   We don't know the font name or version. Even the Menu bar and task bar contents are in Tamil. Minecraft item right/left click detection How can I prove that $$\displaystyle x-\frac {x^2} 2 &lt; \ln(1+x)$$ for any $x&gt;0$  I think it's somehow related to Taylor expansion of natural logarithm, when:  $$\displaystyle \ln(1+x)=\color{red}{x-\frac {x^2}2}+\frac {x^3}3 -\cdots$$  Can you please show me how? Thanks. I have cobbled together a command to return the process ID of a running daemon:  ps aux | grep daemon_name | awk "{ print \$2 }"   It works perfectly and returns the PID, but it also returns a second PID which is presumably the process I'm running now. Is there a way I can exclude my command from the list of returned PIDs?  I've tested it a few times and it appears my command is always the second PID in the list, but I don't want to grab just the first PID in case it's inaccurate. Recently I had to change the folder permissions of /usr folder. Now the whole sudo is not working. If I try to update my system using this command:  sudo apt-get update   I get the following message:  sudo: /usr/lib/sudo/sudoers.so must be only be writable by owner sudo: fatal error, unable to load plugins   So I tried to change the folder permissions by opening Nautilus as root by using this command  gksudo nautilus   But nothing happened. Nautilus didn't open. This is an emergency as the whole of sudo is not working. when I tried searching the solution from Google many suggested re-installation. I don't prefer re-installation. so is there any other solution? Test if a string contains any of the strings from an array I'm working through Rotman (1994). It's the 2nd chapter where my curiosity lead me to a question that is not from the book. Here's the problem that inspired the question:      2.8. Imbed $S_n$ as a subgroup of $A_{n+2}$, but show, for $n\ge2$, that $S_n$ cannot be imbedded in $A_{n+1}.$    Since the alternate subgroup has the property of even parity, I thought that a little investigation of parity for the second and third symmetric groups was in order. So I constructed a table for each of them, grouped by even and odd number of disjoint products.   I'll forego writing the actual table and simply provide the answers. In symmetric groups with an even idegree, two even permutations come together under composition to produce an even permutation. Two odds also make an even. Two different parities produce odd elements.   When the symmetric group has an odd degree, e.g. $S_3$, two odds make an odd, two evens make an odd, and two different parities make an even element. Exactly the opposite results from the symmetric groups with even index.   Two questions: is this enough to prove the $A_{n+1}$ case? And can this be generalized modulo 2 e.g. $A_{2n+1}$?