$(function () { console.log('test start'); $('.mytest').click(function () { var html = '<button>test</button>'; $(this).after(html); }); }); <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <button class="mytest">test1</button> <button class="mytest">test2</button> <button class="mytest">test3</button> When you click '<button>test</button>' again, you need to replace with the same element '<button>test</button>' and not add a new '<button>test</button>' .
replaceWith- Grundy