i have a javascript code and you can see its jsfiddle here.
when wrap all .inner elements with new div, it seems jquery copy javascript code (so you can see two alert when run).
is this a normal behaviour of wrapAll() or this is a bug?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It’s probably because the
<script>tag you have within the element is reevaluated when you wrap it because the dom is rewritten, therefore adding anotherclickcallback. The solution is to move the<script>code with theclickcallback outside of the div.