Started to use addEventListener some weeks ago. It is one case i cant understand so far. We are talking about cases where we printing taggs with templet literals and declaring the class inside thos taggs. After that if we going to use thise classes for other EventListener, somethimes we need to have other EventListener inside the first one(the one who is printing/declaring classes) other times we dont have to have another eventListener inside the first one. Why? Somebody have good explanation or can point me in right direction? I am giving exemples under. Thank you in advance //two different Event Listener were the first one making class and second one using that class  const drink = document.querySelector(&quot;.drink&quot;); let drinkTxt = &quot;&quot;; MenyModule.getDrink().forEach(drink =&gt;{   drinkTxt +=`   &lt;div class=&quot;boks&quot;&gt;     &lt;h4&gt;${drink.name}&lt;/h4&gt;     &lt;p class=&quot;des&quot;&gt;${drink.des}&lt;/p&gt;     &lt;p class=&quot;price&quot;&gt;kr ${drink.price}&lt;/p&gt;     &lt;a class=&quot;button-buy&quot;&gt;BUY&lt;/a&gt;   &lt;/div&gt;   ` }); drink.innerHTML = drinkTxt;   document.querySelectorAll(&quot;.boks&quot;).forEach(boks =&gt;{   boks.addEventListener(&quot;click&quot;, (e)=&gt;{       alert();     })   });   //Second exemple where i need to have other EventListener inside the first one or alert() will not be executed  document.querySelectorAll(&quot;.button-buy&quot;).forEach(button =&gt;{   button.addEventListener(&quot;click&quot;, ()=&gt;{         valgteRetterTxt+=`&lt;a class=&quot;remove1&quot;&gt;REMOVE&lt;/a&gt;`       valgteRetter.innerHTML=valgteRetterTxt;          document.querySelectorAll(&quot;.remove1&quot;).forEach(remove=&gt;{           remove.addEventListener(&quot;click&quot;, ()=&gt;{             alert();           });         });      });   });
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.
Showing that a group of order $pq$ is cyclic if it has normal subgroups of order $p$ and $q$ This is question 2.9 #9 from Topics in Algebra by Herstein:     If $o(G)$ is $pq$ where $p$ and $q$ are distinct prime numbers and if $G$ has a normal subgroup of order $p$ and a normal subgroup of order $q$, prove that $G$ is cyclic.   Let $N$ denote the normal subgroup of order $p$ and $M$ denote the normal subgroup of order $q$. Here are a couple things I noted while exploring the problem:   $N$ and $M$ are cyclic, since they have prime order. $G = NM$ [1].   Any hints where to look next?    [1] Since $N,M$ are normal, $NM \le G$. Then $o(NM) \mid o(G)$, so $o(NM)$ is either $1$, $p$, $q$, or $pq$. The first three don't work because they force one of $N$ or $M$ to be $(e)$, so we have $o(NM) = pq$. Therefore, $NM = G$. Regex to get string between curly braces Maximum value of $\sin A+\sin B+\sin C$? 'help' link is located lower than the other items It shows like this on Firefox 25 and Internet Explorer 11 (minus the red line of course):    Chrome seems to be fine. Can't reach wi-fi signal on Ubuntu, but can do it on other OS/devices (ath9k) Avoiding confusion over the term "Research Assistant" How do I invoke a private static method using reflection (Java)? X, along with Y, "were" or "was"? I was interested in the following sentence which appeared in a   in The Washington Post, Politics, (WHO RUNS GOV).     She, along with Mark Childress, were set to be Daschle's deputies at   the White House before he stepped down.   Can someone clarify if the fragment "She, along with Mark Childress, were set to" is ungrammatical, as I think it is?  I would reword were with was because I think that the subject of the sentence - obviously, in grammatical terms - is "She", not "She" and "Mark Childress", but I'm not sure on this correction.  More precisely, I'm not so sure that "She, along with Mark Childress" is equivalent to She and Mark Childress with regard to the effects on the grammatical numbers. Related posts display randomly by tag I would like to ask that what code should i add in order to make my related posts by tag to display randomly? I got this code from somewhere else.  &lt;?php $orig_post = $post; global $post; $tags = wp_get_post_tags($post-&gt;ID); if ($tags) { $tag_ids = array(); foreach($tags as $individual_tag) $tag_ids[] = $individual_tag-&gt;term_id; $args=array( 'tag__in' =&gt; $tag_ids, 'post__not_in' =&gt; array($post-&gt;ID), 'posts_per_page'=&gt;5, // Number of related posts that will be shown. 'caller_get_posts'=&gt;1 ); $my_query = new wp_query( $args ); if( $my_query-&gt;have_posts() ) { echo '&lt;div id="related"&gt;&lt;h4&gt;Related Posts&lt;/h4&gt;'; while( $my_query-&gt;have_posts() ) { $my_query-&gt;the_post(); ?&gt; &lt;div class="ncc"&gt; &lt;h5&gt;&lt;a href="&lt;? the_permalink()?&gt;" rel="bookmark" title="&lt;?php the_title(); ?&gt;" rel="nofollow"&gt;&lt;?php the_title(); ?&gt;&lt;/a&gt;&lt;/h5&gt; &lt;?php the_excerpt(); ?&gt;  &lt;/div&gt;&lt;!--ncc--&gt;  &lt;? } echo '&lt;/div&gt;&lt;!--related--&gt;'; } } $post = $orig_post; wp_reset_query(); ?&gt;   Any solution? Thanks! Is there a way to Inset in the opposite direction (not Outset)? Is there an operation similar to inset that creates faces in the opposite direction? That is, instead of creating faces inwards, they create faces outwards? A normal inset operation:  What I would like: I want to render an image as a background image via an inline style in twig. I created a field called bg_image and attached it to the standard plain page.  After fiddling around for hours I was able to get the Image URL in node.html.twig  {{ file_url(node.field_bg_image.0.entity.uri.value) }}   but I could not get it to work inside field--field-bg_image.html.twig  Can I get the node from there anyhow, so I can then get the image?  How can I get the image URL to use as inline style? I thought maybe I can pass a variable from field--field-bg_image.html.twig to image.html.twig and then just render  {{ uri }}   instead of  &lt;img{{ attributes.addClass(classes) }} /&gt;   but I could not get it to pass the variable there unless I use includes  {% include 'image.html.twig' with {'image': image, 'isFromField': isFromField} %}   (isFromField is true, when it comes from the field--field-bg_image.html.twig) But that didn't work either. The Image was never rendered that way.  Would be very glad if you can help - my php knowledge is very basic. Thanks Daily reputation cap doesn't account for reputation * loss* due to bounty awarded? There are many Q&amp;A's around this and the best explanation of daily cap model is from this answer that uses . It is an old answer but gives a good understanding.   My confusion is in applying this model to my situation yesterday.    On 31/12/2019, I awarded a bounty to , since it became eligible for bounty (2 days after posting it). Subsequently, I got more upvotes (including one accept) which exceeded the daily cap of 200. I am confused about this-loss of reputation due to bounty awarded by me preceeded subsequent gain of reputation so going by the bucket analogy, I should have my rep adjusted accordingly and those 6 up votes (at the bottom of table) should have been credited (rep should have been 177 instead of 117),  /reputation shows this   2 219845 (10)  1 219884 (2)  2 170717 (10)  2 219621 (10)  2 219845 (10) 2 219845 (10) 2 218537 (10)  2 219845 (10)  2 219892 (10)  2 219845 (10) 8 219821 (-100)  2 219845 (10)  2 219621 (10)  2 219845 (10)  2 219821 (10)  2 219845 (10)  2 219845 (10)  2 219845 (10)  2 219912 (10)  1 219912 (15)  2 219845 (10)  2 219845 (10)  2 219892 [10]  2 219845 [0]  2 219621 [0]  2 219845 [0]  2 219845 [0]  2 219845 [0]  2 219845 [0]  -- 2019-12-31 rep +117 = 27089 --   It is not the 6 votes I am bothered about, it is more about trying to correct my understanding  or have I stumbled upon an anomaly? I know roughly and informally what a confidence interval is.  However, I can't seem to wrap my head around one rather important detail:  According to Wikipedia:     A confidence interval does not predict that the true value of the parameter has a particular probability of being in the confidence interval given the data actually obtained.     I've also seen similar points made in several places on this site.  A more correct definition, also from Wikipedia, is:     if confidence intervals are constructed across many separate data analyses of repeated (and possibly different) experiments, the proportion of such intervals that contain the true value of the parameter will approximately match the confidence level   Again, I've seen similar points made in several places on this site.  I don't get it.  If, under repeated experiments, the fraction of computed confidence intervals that contain the true parameter $\theta$ is $(1 - \alpha)$, then how can the probability that $\theta$ is in the confidence interval computed for the actual experiment be anything other than $(1 - \alpha)$?  I'm looking for the following in an answer:   Clarification of the distinction between the incorrect and correct definitions above. A formal, precise definition of a confidence interval that clearly shows why the first definition is wrong. A concrete example of a case where the first definition is spectacularly wrong, even if the underlying model is correct. A general question asked from time to time on stack exchange is question of trigger bulkification.  Therefore I have 2 questions:   Which best practices are you using? What is the best way to handle updates of more than 200 records? (In case of more than 200 records the trigger is executed more than once.) Resizing an image in a post? I am trying to write code with rotates an object.  I implemented it as:  Rotation about X-axis is given by the amount of change in y coordinates of a mouse and  Rotation about Y-axis is given by the amount of change in x coordinates of a mouse.  This method is simple and work fine until on the the axis coincides with Z-axis, in short a gimble lock occurs.  How can I utilize the rotation arount Z-axis to avoid gimbal lock. Set up a scheduled job? How to switch render source (VSE or Camera)? If you create a scene for the Video Sequence Editor and start working on a project Blender will render the output from the VSE. But if you want to later switch it to render your 3D scene again (the camera output) where is the setting to select the source?  Usually I keep a separate .blend for VSE edits so I don't need to switch, but I feel like I ought to learn how to do this as it's pretty basic. I would expect to find this in the Render context but I see no place to specify the source.  Thanks. Why is \[ ... \] preferable to $$ ... $$? I've heard that you should use \[ ... \] for displayed equations instead of  $$ ... $$, but why is that?  I'd assumed that it's so that you can more easily tell which are starting and which are ending delimiters, but if I always use a syntax-highlighting text editor, I can see that easily based on the color of the symbols.  Is there any reason for this suggestion? find pair of numbers whose difference is an input value 'k' in an unsorted array