How to active class click function after using 'createElement' I am trying to active function when clicking on button which is created with createElement.  On html code:  &lt;fieldset class="form-fieldset"&gt;    &lt;button type="button" class="btn-ref"&gt;Hello&lt;/button&gt; &lt;/fieldset&gt;   On javascript:  $('.btn-ref').click(function(){    var newButton = document.createElement('button');    newButton.className="btn-ref";    $('.form-fieldset').append(newButton); });   On original code, when clicking on button does create new button. But after clicking on created button, it does not create new button.  Can someone tell me what is wrong?
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.
Changing colors of lightning-button Evaluate this power series Evaluate the sum  $$x+\frac{2}{3}x^3+\frac{2}{3}\cdot\frac{4}{5}x^5+\frac{2}{3}\cdot\frac{4}{5}\cdot\frac{6}{7}x^7+\dots$$  Totally no idea. I think this series may related to the $\sin x$ series because of those missing even powers. Another way of writing this series:  $$\sum_{k=0}^{\infty}\frac{(2k)!!}{(2k+1)!!}x^{2k+1}.$$ If we have a function $f:A \rightarrow B$, then one way to give meaning, I think, to this function, in terms of set theory, is to say, that $f$ is actually a binary relation $f=(A,B,G_f)$, where $G_f \subseteq A \times B$ is the graph of the function. Now my question is: what is $f$ if   $\bullet \ A=\emptyset, \ B\neq\emptyset$,?  $ \bullet \ B=\emptyset, \ A\neq\emptyset$ ?  $ \bullet \ B=\emptyset, \ A=\emptyset$ ?  (Another way to formulate this, I think, would be: How do the sets $\emptyset\times B,\ A\ \times \emptyset, \ \emptyset \times \emptyset $ look like? Are they all $\emptyset$ ?) Non-hidden directory doesn't show in Explorer, but the program that made it can access it Is a   select *  from myView   faster than the query itself to create the view (in order to have the same resultSet):  select * from ([query to create same resultSet as myView])   ?  It's not totally clear to me if the view uses some sort of caching making it faster compared to a simple query. Unemployed person applying for UK visa Let f be an r-cycle in $S_n$. Given any $h \in S_n$, show that $hfh^{-1} = (h(x_1), h(x_2), \dots, h(x_r))$ I use a dual monitor.  The colors appear entirely different on the new monitor than they do on my laptop.  When you are selecting colors etc, to be included in a website design, it totally freaks me out.  Is there no software solution that finds how the settings of one of the monitor is and puts that to the second one?  Otherwise what all settings do I need to change manually on the second monitor to make it appear as it does on the laptop?  Thanks in advance. I know that for every $n\in\mathbb{N}$, $n\ge 1$, there exists $p(x)\in\mathbb{F}_p[x]$ s.t. $\deg p(x)=n$ and $p(x)$ is irreducible over $\mathbb{F}_p$.     I am interested in counting how many such $p(x)$ there exist (that is, given $n\in\mathbb{N}$, $n\ge 1$, how many irreducible polynomials of degree $n$ exist over $\mathbb{F}_p$).   I don't have a counting strategy and I don't expect a closed formula, but maybe we can find something like "there exist $X$ irreducible polynomials of degree $n$ where $X$ is the number of...".  What are your thoughts ? Drawing a triangle from medians US Election results 2016: What went wrong with prediction models? First it was , now the US election. Many model predictions were off by a wide margin, and are there lessons to be learned here? As late as 4 pm PST yesterday, the betting markets were still favoring Hillary 4 to 1.  I take it that the betting markets, with real money on the line, should act as an ensemble of all the available prediction models out there. So it's not far-fetched to say these models didn't do a very good job.  I saw one explanation was voters were unwilling to identify themselves as Trump supporters. How could a model incorporate effects like that?  One macro explanation I read is the rise of . The question then is how could a statistical model capture a macro trend like that?  Are these prediction models out there putting too much weight on data from polls and sentiment, not enough from where the country is standing in a 100 year view? I am quoting a friend's comments. Primary key or Unique index? At work we have a big database with unique indexes instead of primary keys and all works fine.  I'm designing new database for a new project and I have a dilemma:  In DB theory, primary key is fundamental element, that's OK, but in REAL projects what are advantages and disadvantages of both?  What do you use in projects?  EDIT: ...and what about primary keys and replication on MS SQL server? Basically, I have a kindle fire that uses a form of the android OS and was wondering if there was a way I could run similar apps on my Ubuntu system. Specifically I'd like the news reader program "Pulse".  Anybody know if such an emulator or workaround exists? Casting a Somatic, non-Material spell while holding a focus In  a side issue came up of whether you can cast a spell with Somatic components but no Material components while holding a focus in the hand used for Somatic components.  My reading of the rules sees "A spellcaster must have a hand free to access a spell's material components--or to hold a spellcasting focus--but it can be the same hand that he or she uses to perform somatic components." - it doesn't say you have to be holding the focus for the purpose of avoiding materials.  However, @Adeptus and @enkryptor argue that - since that rule is in the section on Material components - you don't consult it in for spells without Material, and fall back to the Somatic rule "the caster must have free use of at least one hand".  (I also appeal to the logic of fluff - why should it be harder to cast a spell with fewer components?)  Is there an official RAW or Word Of God on this matter? Can you cast a material-less, somatic spell while holding a focus in your only free hand? How do I rotate a tikz rectangle about a specific axis? I am trying to create a beamer animation using tikz, but I can't even get basic rotating of a tikz image working as desired.  I have a rectangle specified by  \draw[rounded corners,dotted] (-3.5,0) rectangle (-0.5,2);   I would like to rotate this rectangle about the point (-1,.5) (which is near the bottom right corner of the rectangle).  I've tried:  {\rotatebox[origin=c,x=-1,y=.5]{130}{             \draw[rounded corners,dotted] (-3.5,0) rectangle (-0.5,2);}}   But this produces an error.  If I just use the origin=c option, it compiles, but it rotates the rectangle about the point (0,0).  I've also tried it with just the x=-1,y=.5 (without the origin option), and it fails to compile.  I have searched the documentation, which is where I learned about the options x=xdim and y=ydim.  However, I can't find a single example demonstrating how these options should be used.  Any suggestions would be greatly appreciated.    Also, if there is a better command for rotating things that will be more suitable for use in a beamer animation, please let me know.  Thanks! Unfair 3 Sided Die Question Say you have an unfair 3-sided die.  Side 1 will be rolled with probability $P_1.$ Side 2 will be rolled with probability $P_2.$ Side 3 will be rolled with probability $P_3.$  Find a formula for the probability that the 8th 3 will be rolled on the 10th roll.  Here is how I started:  $$ \sum_{i=8}^{10}P(T_8 = i) $$  Im just having trouble with that expansion? MSBuild exec task with for I am trying to run the following commands as part of an MSBuild script:  for /R . %f in (*.targets) do copy /Y "%f" "C:\Program Files (x86)\MSBuild\Microso ft\VisualStudio\TeamBuild"   The commands is implemented in an exec the following way:  &lt;Exec WorkingDirectory="$(SolutionRoot)" Command="for /R . %f in (*.targets) do copy /Y &amp;quot;%f&amp;quot; &amp;quot;$(MSBuildExtensionsPath)\Microsoft\VisualStudio\TeamBuild&amp;quot;" /&gt;   The command works fine from console, but when trying to run it from MSBuild I get the error:   Task "Exec"   Command:   for /R . %f in (*.targets) do copy /Y "%f" "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\TeamBuild"   f" "C:\Program was unexpected at this time. C:\Users\rd-build\AppData\Local\Temp\OH Test2\Continuous.BuildTargets\BuildType\TFSBuild.proj(98,5): error MSB3073: The command "for /R . %f in (*.targets) do copy /Y "%f" "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\TeamBuild"" exited with code 255. Done executing task "Exec" -- FAILED.   Any suggestions? Email Templates: Conditional Greeting Based on Time of Day I have some questions regarding suspended users:   Why do suspended users have a reputation of one? According to the default reputation of a new user, he/she will have reputation of one and he/she has the privilege of posting questions. When comparing this, this is getting violated when compared to suspended users' reputation. Even though they have one reputation point, they cannot post questions. As suspended users do not have privilege of posting questions, there is no use of making "Ask Question" visible. This is an unnecessary server hit. Am I right? As suspended users do not have the privilege of answering questions, there is no use of making "Answer Question" visible. How to keep the spaces at the end and/or at the beginning of a String?