I have a clickable &lt;div&gt;, in which I am adding &lt;img&gt; tags using jQuery. All the &lt;img&gt; tags have the same id. I want to click on the inserted image and handle the event for that element, but  I get the &lt;div&gt;'s event handler, instead. I have tried e.preventDefault() and e.stopImmediatePropagation() both on the &lt;div&gt; and added images, but it is not working.  Javascript:  $(document).ready(function () {   $("#container").click(function (e) {       debugger;       e.preventDefault();       var x = e.pageX - this.offsetLeft;       var y = e.pageY - this.offsetTop;        var img = $('&lt;img&gt;');       img.css('top', y);       img.css('left', x);       img.attr('id', 'marking');        var selectedItem = $('#markerItem').val();       if (selectedItem == 'b') {           img.attr('src', 'broken.png');       }       else if (selectedItem == 'd') {           img.attr('src', 'damage.png');       }       else if (selectedItem == 's') {           img.attr('src', 'scratch.png');       }       else if (selectedItem === null || selectedItem === undefined || selectedItem === "") {           img.attr('src', 'damage.png');       }       img.appendTo('#container');   }),    $("#marking").click(function (e) {       debugger;       e.stopImmediatePropagation();       $('img[id$="marking"]').remove();   }) });   HTML:  &lt;div id="container"&gt;      &lt;img src="" height="475" width="600" alt="Image preview..." id="img1"&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.
Should I submit https:// and http:// in Google Search Console both with and without the www? In my site I'm redirecting everything (http://, http://www., https://) to https://www.example.com.  Google webmaster tools says: Make sure you add both "www" and "non-www" versions for your site. Also, if you use the HTTPS protocol, add those variations as well.  So I've added all the FOUR versions to google webmaster tools. Is this a correct process? Write in NTFS using Mavericks I was able to read and write NTFS filesystems normally in Mountain Lion, but after the upgrade this stopped to work.  I installed ntfs-3g and fuse4x using homebrew in Mountain Lion and followed the instructions displayed by homebrew to finish the installation of fuse4x kernel extension.  To try to solve this problem I removed ntfs-3g, fuse4x and fuse4x-kext and reinstalled them. But this didn't solve my problem.  Does anyone know how to solve this? Thanks. How do I disable "Link Preview" in Chrome? What does $\dot\sim$ notation (dot over tilde) mean, in the context like $x \mathrel{\dot\sim} \mathcal N(0,1)$?  Turns out it is easier to find how to typeset it correctly:  that one should type \mathrel{\dot\sim} instead of simply \dot\sim to fix the spacing issue -- than to find what it actually means. It has only been used  on CV until now; is it standard? I faced this issue when I want to use sudo command :  sudo: /etc/sudoers is owned by uid 1000, should be 0 sudo: no valid sudoers sources found, quitting sudo: unable to initialize policy plugin   then I tried a solution from a similar question in order to change the owner back to the root:   $ pkexec visudo   also I tried this one   $ pkexec chown root:root /etc/sudoers /etc/sudoers.d -R   but I have faced another issue with these commands:   Error getting authority: Error initializing authority: Could not connect: No such file or directory   So is there a solution to this issue?    Full shell issue snippets:   ubuntu@LAPTOP-D4T16P7J:~$ sudo -i sudo: /etc/sudoers is owned by uid 1000, should be 0 sudo: no valid sudoers sources found, quitting sudo: unable to initialize policy plugin ubuntu@LAPTOP-D4T16P7J:~$ pkexec visudo Error getting authority: Error initializing authority: Could not connect: No such file or directory ubuntu@LAPTOP-D4T16P7J:~$ pkexec chown root:root /etc/sudoers /etc/sudoers.d -R Error getting authority: Error initializing authority: Could not connect: No such file or directory     This is my /etc/sudoers file:   ubuntu@LAPTOP-D4T16P7J:~$ cat /etc/sudoers # # This file MUST be edited with the 'visudo' command as root. # # Please consider adding local content in /etc/sudoers.d/ instead of # directly modifying this file. # # See the man page for details on how to write a sudoers file. # Defaults        env_reset Defaults        mail_badpass Defaults        secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin"  # Host alias specification  # User alias specification  # Cmnd alias specification  # User privilege specification root    ALL=(ALL:ALL) ALL  # Members of the admin group may gain root privileges %admin ALL=(ALL) ALL  # Allow members of group sudo to execute any command %sudo   ALL=(ALL:ALL) ALL  # See sudoers(5) for more information on "#include" directives:  #includedir /etc/sudoers.d     OS info:    Ubuntu WSL2. Enumerate behaves differently with beamer 3.42 The following is produced by beamer version 3.41 with enumerate:  \documentclass{beamer} \mode&lt;presentation&gt;     {\usetheme{Rochester}} \begin{document} \begin{frame}   \begin{enumerate}[(a)]     \item Foo     \item Bar   \end{enumerate}   \begin{enumerate}[1]     \item Foo     \item Bar   \end{enumerate} \end{frame} \end{document}     And with beamer version 3.42 the following:    The latter output is so, well, ugly, that it's probably a bug. While waiting for a bug fix (?), how can I temporarily fix this so that I get the output produced by beamer 3.41? Root drive is running out of disk space. How can I free up space? Explicit example of a compact manifold of dimension $>2$ with strictly negative sectional curvature I am looking for examples of compact manifold of dimension $&gt;2$ with strictly negative sectional curvature (for dimension 2 it is well-known). Can anybody please help? How do I calculate the CRC32 (Cyclic Redundancy Checksum) of a string in .NET? What should children call a step-grandparent? My mom remarried to a great guy who has been absolutely wonderful to my kids. Ever since my mom and he were dating my kids have called him Mr. Joe. Lately my mom has been bugging me to get the kids to call him Grampa.  I agree that he deserves more respect than Mr.  The problem is that he isn't their real grampa so I don't really want them calling him that. Does anybody have any suggestions on what we should have the kids call him? They are 9 and 12 years old.  EDIT: I appreciate the comments regarding different variations of grampa and hearing how others have no issues with calling their step-granddad grampa. But I was hoping maybe someone has some suggestions for names that show the importance of the step-granddad without calling him some variation of the grampa name but still has a feeling of warmth and family in the name (I hope that makes sense). Oneboxing is a handy feature in chat for quickly previewing links, but the list of supported sites is very small, and occasionally boxes for sites such as Wikipedia can break and fetch any image/text.  Instead of having to request additional sites to be added to the onebox list (, , , , , and of course ), we could let the sites themselves handle the oneboxing with some &lt;meta&gt; tags, such as:  &lt;meta name="onebox-title" content="The Onebox Title"/&gt; &lt;meta name="onebox-image" content="/image.png"/&gt; &lt;meta name="onebox-summary" content="This is the summary for a site's onebox"/&gt;   Then when a link is placed on its own in chat, the oneboxing spider would look for these tags and, if they are found, show the appropriate data.  Support for these tags would certainly be bad (for lack of any real better term) at first, though most users of SO chat could easily add it to their personal / company's sites (should they be in such a position) and writing friendly suggestions to other sites to implement them isn't exactly a gargantuan effort.  This would also present an opportunity for currently oneboxed sites to set in stone what should be shown, such as each Wikipedia article setting the main image to be oneboxed instead of SO's spider picking one willy-nilly.  Finally, sites implementing these tags would lay the foundation for other sites and services to develop similar features to the onebox, without having to write per-site scrapers. Why do all SSH-RSA Keys begin with "AAAAB3NzaC1yc"? How to create a Wi-Fi Hotspot (in Access Point mode)? Should postdocs work only on the projects they are hired for, or can they work with other people in the same research group on other projects? Would the latter be an issue with the funding body, when the project proposal and budget only covers the expenses for hiring one postdoc? Note: it is the supervisors who got the grants, not the postdocs themselves. How to type a circumflex over a greek letter in text mode? Should I use 'or' or 'nor' after a negative statement? Strange grey bordering/outline in Illustrator I made a couple of vector shapes in AI and I get this strange thin border appearing around them. I can't get rid of it. Any suggestions?    Zoomed in: Is there a NumPy function to return the first index of something in an array? I know there is a method for a Python list to return the first index of something:  &gt;&gt;&gt; l = [1, 2, 3] &gt;&gt;&gt; l.index(2) 1   Is there something like that for NumPy arrays? Is there a command where I can teleport myself to a specific kind of block? I can't find my house and I have specific kind of blocks in it like beacons, enchantment tables, furnaces, stuff like that. I didn't put a bed and I never viewed the coordinates. Why do modern mountain bike forks no longer use boots on fork stanchions? Older mountain bikes used to have them on the forks, and lefty and headshocks still do. Why have these fallen out of fashion and would putting aftermarket fork boots on your stanchions be productive or not?