jQuery(document).ready(function(){ var hrefVal=window.location.href; if(hrefVal.indexOf('/checkout/order-received') != -1 && hrefVal.indexOf("key=wc_order_")!=-1) { jQuery('body').append(''); } });