[Solved] jQuery : Hide select DOM elements created on the fly
[ad_1] This can be achieved with a single line that manipulates the DOM using the append, filter and hide jQuery methods. $(‘selector2’).append(thingo) – append the items .filter(‘selector1’) – of the original selector, only select those matching the filter .hide() – hide the filtered items Like this: $(function() { var thingo = $(‘<div />’); $(‘selector2’).append(thingo).filter(‘selector1’).hide(); } … Read more