I'm trying to add a .on event to a dynamically created element, but it doesn't seem to be working.  My table renders correctly, but nothing happens when I click on my exp_col div, not even an error message.  Have I done something incorrectly here?      jQuery.each(items, function(index, item) {         jQuery('&lt;tr&gt;')             .addClass('item_class')             .append(                 jQuery('&lt;td/&gt;')                     .addClass('text')                     .text('XXX')                     .append(                         jQuery('&lt;div /&gt;')                             .addClass('exp_col')                             .text('More...')                     )                 )              .append(jQuery('&lt;td/&gt;').addClass('info').text('yyy'))         .appendTo(table);      });      table.on("click", ".exp_col", function(e) {          myFunc( this );     });     table.appendTo(div);   Satpai's answer below is perfect, but instead of a console.log, if I was to call a function which did some CSS tinkering, and then removed the itself and added a new function. How could I accomplish that?  function myFunc(ele){     //does some css stuff            jQuery(ele).off(); }  function myOtherFunc(ele){     //removes the css stuff     jQuery(ele).off(); }   My overall goal is to toggle two functions on and off.
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.
Unicode Processing in C++ What is the best practice of Unicode processing in C++? Unique (non-repeating) random numbers in O(1)? I want to advance in the ranks of Senator Lavigny-Duval. How can I get merit points? I know I can participate in expansion goals, but is there a better way than that? I am trying to make a floor plan for my office, have managed to make all of the rectangular components (e.g. the rooms) however some of the desk layouts are circular and I haven't been able to work out how to make exact and measured circles. They need to have a radius of 1.45m. White's test for heteroskedasticity in R I am trying to estimate heteroskedasticity in R. I had Eviews available in my college's lab but not at home. I have been trying to use "het.test" package and whites.htest but the value that I get is different from what I get in Eviews. According to the author of the package, it is meant to do the same test as is done in Eviews.   My model looks like A~B+C. Kindly guide me what I am doing wrong.   I 1st run ols for equation A~B+C, after getting results, I clicked View&gt;Residual diagnostics&gt;Heteroscadicity tests&gt;White's (with Include white cross terms) and then Press ok. The result i got was Prob. F(5,27) = 0.2948.   For R, i tried code at this link [this link][1], here is the edited code that i used.  library(vars)  library(het.test) dataset &lt;- data.frame(A,B,C))  model1 &lt;- VAR(dataset, p = 1)  whites.htest(model1)   This gave me value of 0.63.  I tried searching this forum but none question seemed related. I am not a programmer not statistician so please pardon my ignorance. Regular expression to match a line that doesn't contain a word On September 29th, I created the  tag for  Today, while checking the tag description, I saw that the  seems to be .  Why is that? Why has the Community user "stolen" the spot as author of the tag? Deep cloning objects I want to do something like:  MyObject myObj = GetMyObj(); // Create and fill a new object MyObject newObj = myObj.Clone();   And then make changes to the new object that are not reflected in the original object.  I don't often need this functionality, so when it's been necessary, I've resorted to creating a new object and then copying each property individually, but it always leaves me with the feeling that there is a better or more elegant way of handling the situation.  How can I clone or deep copy an object so that the cloned object can be modified without any changes being reflected in the original object? 2 GROUP BY WITH DISTINCT , SUM , COUNT : PHP MYQL Ref :   I got answer (thanks coytech ) but i need one more column in its :  as per :  id | mid | pid | owgh | nwgh | 1    3      12    1.5    0.6 2    3      12    1.5    0.3 3    3      14    0.6    0.4 4    3      15    1.2    1.1 5    4      16    1.5    1.0 6    4      17    2.4    1.2  7    3      19    3.0    1.4   i got answer      Select mid ,          COUNT(distinct pid) as cpid  ,          SUM(nwgh) as totalnwgh  from test  GROUP BY mid   sqlfiddle :   mid  cpid       totalnwgh 3      4          3.8 4      2          2.2    But above i need one more column that's as below : totowgh  mid cpid        totalnwgh  totowgh 3      4          3.8        6.3 (DISTINCT value as per pid column) 4      2          2.2        3.9   where totowgh = 6.3 come by DISTINCT value of owgh column  as per distinct pid column  mid = 3 has count 5 but distinct pid  = 4 for mid=3 same way "distinct" owgh = 6.3 for mid=3 and distinct pid.  As pid=12 , column owgh value 1.5 is twice ...hence its is count 1 time hence,  1.5 + 0.6 + 1.2 + 3 = 6.3 ( please not this is as per DISTINCT value of pid )  Please note : i need distinct owgh value as per distinct pid or group by pid .. because if i replace value of owgh 0.6 with 1.5 then it will be 5.7 instead of 7.2 but value of owgh 0.6 belong to pid = 14 and not pid = 12 hence totalcount of owgh change ...but i need is 7.2  SEE WHAT I MEANS   : Counting binary operations on a set with $n$ elements I am trying to solve following problem but not able to find any way to proceed.  Let $S$ be a set having $n$ elements. Can we count about number of binary operations that can be defined on a set? Can we also count number of commutative binary operations defined on  $S$?  Thanks for the help and suggestions In what cases do I use malloc and/or new? In short, :     If you go before the Board of   Directors and ask for 1.5 billion   dollars to build a nuclear reactor, no   one will review or discuss the details   of the plant. They will assume that   experts have been over every inch of   the plans, and not want to look   foolish by asking a silly question.      However, if you ask the same group to   approve a 30 dollar expenditure for   lumber with which to build a bikeshed   (presumably a British term for the   smallest possible building) then be   prepared for a 45 minute discussion   about all aspects of the bikeshed,   including the color of the paint. The   explanation for this is that everyone   can grasp the scale of a bikeshed.   To transform this problem to Stack Overflow terms, questions that are trivial such as "How to convert a C string to a QString or "What is the difference between . and ->" get a lot more views, answers and votes than real questions of the form "How do I frob this widget" that bother real professionals. Fewer views mean less possible votes for good answers and hence less incentive for people to answer.  How can Stack Exchange solve this problem? Prove the Radical of an Ideal is an Ideal I am given that $R$ is a commutative ring, $A$ is an ideal of $R$, and $N(A)=\{x\in R\,|\,x^n\in A$ for some $n\}$.  I am studying with a group for our comprehensive exam and this problem has us stuck for two reasons.  FIRST - We decided to assume $n\in\mathbb{Z}^+$ even though this restriction was not given. We decided $n\ne 0$ because then $x^0=1$ and we are not guaranteed unity. We also decided $n\notin\mathbb{Z}^-$ because $x^{-1}$ has no meaning if there are no multiplicative inverses. Is this a valid argument?  SECOND - We want to assume $x,\,y\in N(A)$ which means $x^m,\,y^n\in A$ and use the binomial theorem to expand $(x-y)^n$ which we have already proved is valid in a commutative ring and show that each term is in A so $x-y$ is in $N(A)$. The biggest problem is how to approach the $-y$ if we are not guaranteed unity. Does anyone have any suggestions?  Thank you in advance for any insight. How to create a site in a sitecollection on a remote SPServer using C# I am working on an iGoogle-like application. Content from other applications (on other domains) is shown using iframes.   How do I resize the iframes to fit the height of the iframes' content?  I've tried to decipher the javascript Google uses but it's obfuscated, and searching the web has been fruitless so far.  Update: Please note that content is loaded from other domains, so the  applies. Exclude menu item from the collapse of bootstrap 3 navbar Why does $1+2+3+\cdots = -\frac{1}{12}$? I don't know how to disconnect a face from the rest of the mesh in edit mode.  This isn't like pressing P to separate the selection into a completely different object. I just want to select a face and disconnect/rip it away from the rest of the mesh but keep it as a part of the original object.  One way to do it would be to duplicate the face with ShiftD and then delete the original face. But I suspect there is a "native" command for disconnecting selected faces and I would like to learn it. Does "Delete Local Content" retain save files? If you remove a single player game installation with the Delete Local Content option from the Steam Libary, in general will save files be deleted or retained? What is the best way to store fresh herbs like parsley or cilantro?  I find I have about the same luck with them whether they are left in a plastic bag or I put them in a cup of water.